summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter/pointreseteable.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-02 00:24:22 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-02 00:24:22 +0000
commit3a6de49f3e570d7646984a800972da6c1ee2154b (patch)
tree5be19bf926fb46fff22a3e622fdbd5d5ca2bc0a4 /src/live_effects/parameter/pointreseteable.cpp
parentMatch function definition and declaration syntax. Mismatch pointed out by dox... (diff)
downloadinkscape-3a6de49f3e570d7646984a800972da6c1ee2154b.tar.gz
inkscape-3a6de49f3e570d7646984a800972da6c1ee2154b.zip
Added shorcut to move along axes, point reseteable parameter,pointed by Vlada, also fixed some UX styles in lattice2 and perspective envelope, pointed by suv. A question: Can I update point parameter whith pointreseteable parameter features, to have only one point parameter?
(bzr r13959)
Diffstat (limited to 'src/live_effects/parameter/pointreseteable.cpp')
-rw-r--r--src/live_effects/parameter/pointreseteable.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/live_effects/parameter/pointreseteable.cpp b/src/live_effects/parameter/pointreseteable.cpp
index c0f8858b8..58de350b6 100644
--- a/src/live_effects/parameter/pointreseteable.cpp
+++ b/src/live_effects/parameter/pointreseteable.cpp
@@ -161,9 +161,20 @@ private:
};
void
-PointReseteableParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
+PointReseteableParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &origin, guint state)
{
- Geom::Point const s = snap_knot_position(p, state);
+ Geom::Point s = snap_knot_position(p, state);
+ if (state & GDK_CONTROL_MASK) {
+ Geom::Point A(origin[Geom::X],p[Geom::Y]);
+ Geom::Point B(p[Geom::X],origin[Geom::Y]);
+ double distanceA = Geom::distance(A,p);
+ double distanceB = Geom::distance(B,p);
+ if(distanceA > distanceB){
+ s = B;
+ } else {
+ s = A;
+ }
+ }
pparam->param_setValue(s);
sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false);
}