diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-11-18 18:10:22 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-11-18 18:10:22 +0000 |
| commit | a6d9d1d88e4a31033d0a96bf2d9f7e93cbdf4534 (patch) | |
| tree | 19910642bbb7c4b3105b0da1f578fee0a6a1d24f /src/ui/tool/node.cpp | |
| parent | Shift should disable snapping when dragging the rotation center of an object (diff) | |
| download | inkscape-a6d9d1d88e4a31033d0a96bf2d9f7e93cbdf4534.tar.gz inkscape-a6d9d1d88e4a31033d0a96bf2d9f7e93cbdf4534.zip | |
Fix four minor node tool regressions:
* Inverted modifier for spatial/linear grow
* PgDn/PgUp keyboard shortcuts for grow
* Shift during drag disables snapping
* Clicking on the background deselects first the nodes and then the path
Fixed bugs:
- https://launchpad.net/bugs/647498
- https://launchpad.net/bugs/588628
(bzr r9904)
Diffstat (limited to 'src/ui/tool/node.cpp')
| -rw-r--r-- | src/ui/tool/node.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 6460d9062..12d04dd2b 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -728,8 +728,7 @@ NodeType Node::parse_nodetype(char x) /** Customized event handler to catch scroll events needed for selection grow/shrink. */ bool Node::_eventHandler(GdkEvent *event) { - static NodeList::iterator origin; - static int dir; + int dir = 0; switch (event->type) { @@ -740,14 +739,34 @@ bool Node::_eventHandler(GdkEvent *event) dir = -1; } else break; if (held_control(event->scroll)) { - _selection.spatialGrow(this, dir); + _linearGrow(dir); } else { + _selection.spatialGrow(this, dir); + } + return true; + case GDK_KEY_PRESS: + switch (shortcut_key(event->key)) + { + case GDK_Page_Up: + dir = 1; + break; + case GDK_Page_Down: + dir = -1; + break; + default: goto bail_out; + } + + if (held_control(event->key)) { _linearGrow(dir); + } else { + _selection.spatialGrow(this, dir); } return true; default: break; } + + bail_out: return ControlPoint::_eventHandler(event); } @@ -946,7 +965,9 @@ void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) // constrainedSnap() methods to enforce the constraints, so we need // to setup the snapmanager anyway; this is also required for someSnapperMightSnap() sm.setup(_desktop); - bool snap = sm.someSnapperMightSnap(); + + // do not snap when Shift is pressed + bool snap = !held_shift(*event) && sm.someSnapperMightSnap(); Inkscape::SnappedPoint sp; std::vector<Inkscape::SnapCandidatePoint> unselected; |
