From: buliabyak Date: Tue, 24 Feb 2009 11:31:49 +0000 (+0000) Subject: limit dot creation to straight line modes of Pen only X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6b23e5f568c026384ba64adb4fc8ed881425f877;p=inkscape.git limit dot creation to straight line modes of Pen only --- diff --git a/src/pen-context.cpp b/src/pen-context.cpp index c8dae0bdd..d0889b4ec 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -471,17 +471,17 @@ static gint pen_handle_button_press(SPPenContext *const pc, GdkEventButton const if (pc->npoints == 0) { Geom::Point p; - if (bevent.state & GDK_CONTROL_MASK) { + if ((bevent.state & GDK_CONTROL_MASK) && (pc->polylines_only || pc->polylines_paraxial)) { p = event_dt; if (!(bevent.state & GDK_SHIFT_MASK)) { SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop); - m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, p, Inkscape::SNAPSOURCE_HANDLE); + m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, p, Inkscape::SNAPSOURCE_HANDLE); } - spdc_create_single_dot(event_context, p, "/tools/freehand/pen", bevent.state); - ret = TRUE; - break; - } + spdc_create_single_dot(event_context, p, "/tools/freehand/pen", bevent.state); + ret = TRUE; + break; + } // TODO: Perhaps it would be nicer to rearrange the following case // distinction so that the case of a waiting LPE is treated separately diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp index 3e3a95c24..fc2088a17 100644 --- a/src/pencil-context.cpp +++ b/src/pencil-context.cpp @@ -257,15 +257,6 @@ pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &beve m.setup(desktop); sp_canvas_set_snap_delay_active(desktop->canvas, true); - if (bevent.state & GDK_CONTROL_MASK) { - if (!(bevent.state & GDK_SHIFT_MASK)) { - m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, p, Inkscape::SNAPSOURCE_HANDLE); - } - spdc_create_single_dot(event_context, p, "/tools/freehand/pencil", bevent.state); - sp_canvas_set_snap_delay_active(desktop->canvas, false); - ret = true; - break; - } if (anchor) { p = anchor->dp; desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Continuing selected path")); @@ -425,11 +416,8 @@ pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &re case SP_PENCIL_CONTEXT_IDLE: /* Releasing button in idle mode means single click */ /* We have already set up start point/anchor in button_press */ - if (!(revent.state & GDK_CONTROL_MASK)) { - // Ctrl+click creates a single point so only set context in ADDLINE mode when Ctrl isn't pressed - pc->state = SP_PENCIL_CONTEXT_ADDLINE; - //sp_canvas_set_snap_delay_active(dt->canvas, true); - } + pc->state = SP_PENCIL_CONTEXT_ADDLINE; + //sp_canvas_set_snap_delay_active(dt->canvas, true); ret = TRUE; break; case SP_PENCIL_CONTEXT_ADDLINE: