diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2012-12-16 05:41:25 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2012-12-16 05:41:25 +0000 |
| commit | 7ec903c9898f872dbd9426ed7a62e1969fdb7be7 (patch) | |
| tree | a306139e829118a83516af02279c9eafd3440eaa /src/knot-holder-entity.cpp | |
| parent | Hershey Text: whitespace; py: docstring, modeline; inx: fix attribute value (diff) | |
| parent | Translations.Spanish translation update by Lucas Vieites. (diff) | |
| download | inkscape-7ec903c9898f872dbd9426ed7a62e1969fdb7be7.tar.gz inkscape-7ec903c9898f872dbd9426ed7a62e1969fdb7be7.zip | |
merge from trunk (r11955)
(bzr r11687.1.3)
Diffstat (limited to 'src/knot-holder-entity.cpp')
| -rw-r--r-- | src/knot-holder-entity.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp index cb8f29f46..75732f805 100644 --- a/src/knot-holder-entity.cpp +++ b/src/knot-holder-entity.cpp @@ -89,8 +89,12 @@ KnotHolderEntity::update_knot() } Geom::Point -KnotHolderEntity::snap_knot_position(Geom::Point const &p) +KnotHolderEntity::snap_knot_position(Geom::Point const &p, guint state) { + if (state & GDK_SHIFT_MASK) { // Don't snap when shift-key is held + return p; + } + Geom::Affine const i2dt (item->i2dt_affine()); Geom::Point s = p * i2dt; @@ -103,8 +107,12 @@ KnotHolderEntity::snap_knot_position(Geom::Point const &p) } Geom::Point -KnotHolderEntity::snap_knot_position_constrained(Geom::Point const &p, Inkscape::Snapper::SnapConstraint const &constraint) +KnotHolderEntity::snap_knot_position_constrained(Geom::Point const &p, Inkscape::Snapper::SnapConstraint const &constraint, guint state) { + if (state & GDK_SHIFT_MASK) { // Don't snap when shift-key is held + return p; + } + Geom::Affine const i2d (item->i2dt_affine()); Geom::Point s = p * i2d; @@ -148,7 +156,7 @@ PatternKnotHolderEntityXY::knot_set(Geom::Point const &p, Geom::Point const &ori SPPattern *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); // FIXME: this snapping should be done together with knowing whether control was pressed. If GDK_CONTROL_MASK, then constrained snapping should be used. - Geom::Point p_snapped = snap_knot_position(p); + Geom::Point p_snapped = snap_knot_position(p, state); if ( state & GDK_CONTROL_MASK ) { if (fabs((p - origin)[Geom::X]) > fabs((p - origin)[Geom::Y])) { @@ -220,7 +228,7 @@ PatternKnotHolderEntityScale::knot_set(Geom::Point const &p, Geom::Point const & SPPattern *pat = SP_PATTERN(SP_STYLE_FILL_SERVER(SP_OBJECT(item)->style)); // FIXME: this snapping should be done together with knowing whether control was pressed. If GDK_CONTROL_MASK, then constrained snapping should be used. - Geom::Point p_snapped = snap_knot_position(p); + Geom::Point p_snapped = snap_knot_position(p, state); // get angle from current transform gdouble theta = sp_pattern_extract_theta(pat); |
