diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2012-10-18 18:06:35 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2012-10-18 18:06:35 +0000 |
| commit | 9158a2ccc3f6238e3f511d078b4d0ef942f30e9b (patch) | |
| tree | cb4a833c8d624bfb1d36052c8088c4f835cfb031 /src/knot-holder-entity.cpp | |
| parent | Fix SVG formatting (EMF import): (diff) | |
| parent | Translations. Latvian translation update by Jānis Eisaks. (diff) | |
| download | inkscape-9158a2ccc3f6238e3f511d078b4d0ef942f30e9b.tar.gz inkscape-9158a2ccc3f6238e3f511d078b4d0ef942f30e9b.zip | |
merge from trunk (r11808)
(bzr r11668.1.30)
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); |
