diff options
| author | Martin Owens <doctormo@gmail.com> | 2016-03-20 02:42:23 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2016-03-20 02:42:23 +0000 |
| commit | 2ab92c531add6a786d4a9cacf41ce33381c2ffe2 (patch) | |
| tree | ab6147c665ca6828340cec8e09a7d67a8926b3a5 /src | |
| parent | Merge lp:~inkscape.dev/inkscape/copy-rotate-lpe-improvements (diff) | |
| download | inkscape-2ab92c531add6a786d4a9cacf41ce33381c2ffe2.tar.gz inkscape-2ab92c531add6a786d4a9cacf41ce33381c2ffe2.zip | |
Add Shift+Enter path complete and larger square node on mouse over.
(bzr r14721)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/draw-anchor.cpp | 9 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/ui/draw-anchor.cpp b/src/ui/draw-anchor.cpp index 6b9a88ed7..e5a7a493e 100644 --- a/src/ui/draw-anchor.cpp +++ b/src/ui/draw-anchor.cpp @@ -26,6 +26,9 @@ using Inkscape::ControlManager; #define FILL_COLOR_NORMAL 0xffffff7f #define FILL_COLOR_MOUSEOVER 0xff0000ff +#define NODE_SIZE_NORMAL 7.0 +#define NODE_SIZE_MOUSEOVER 10.0 + /** * Creates an anchor object and initializes it. */ @@ -78,14 +81,16 @@ SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, bool acti if ( activate && ( Geom::LInfty( w - anchor->dc->getDesktop().d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) { if (!anchor->active) { - g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, + "size", NODE_SIZE_MOUSEOVER, NULL); anchor->active = TRUE; } return anchor; } if (anchor->active) { - g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, NULL); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, + "size", NODE_SIZE_NORMAL, NULL); anchor->active = FALSE; } return NULL; diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index 2ed366a7d..ff49417f4 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -1220,7 +1220,19 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { case GDK_KEY_KP_Enter: if (this->npoints != 0) { this->ea = NULL; // unset end anchor if set (otherwise crashes) - this->_finish(false); + if(MOD__SHIFT_ONLY(event)) { + // All this is needed to stop the last control + // point dispeating and stop making an n-1 shape. + Geom::Point const event_w(0, 0); + Geom::Point event_dt(desktop->w2d(event_w)); + if(this->red_curve->is_empty()) { + this->red_curve->moveto(event_w); + } + this->_finishSegment(event_w, 0); + this->_finish(true); + } else { + this->_finish(false); + } ret = true; } break; |
