Code

restore ctrl+click dots in pencil
authorbuliabyak <buliabyak@users.sourceforge.net>
Thu, 3 Sep 2009 16:22:43 +0000 (16:22 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Thu, 3 Sep 2009 16:22:43 +0000 (16:22 +0000)
src/pencil-context.cpp
src/ui/dialog/inkscape-preferences.cpp

index 31b7441d4779770cc399b851308b77534e70bc36..d6050ba04e9da0e8f495a334991af59887bffdfa 100644 (file)
@@ -256,6 +256,14 @@ pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &beve
                SnapManager &m = desktop->namedview->snap_manager;
                                m.setup(desktop);
 
+                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);
+                    ret = true;
+                    break;
+                }
                 if (anchor) {
                     p = anchor->dp;
                     desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Continuing selected path"));
@@ -415,7 +423,10 @@ 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 */
-                pc->state = SP_PENCIL_CONTEXT_ADDLINE;
+                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;
+                }
                 ret = TRUE;
                 break;
             case SP_PENCIL_CONTEXT_ADDLINE:
index b75fdc6c2132039297b0cfda1032db7303a3d751..9b6d9e0847bde98e24e5ba718af1d4971f4fa91f 100644 (file)
@@ -486,6 +486,7 @@ void InkscapePreferences::initPageTools()
     this->AddPage(_page_pencil, _("Pencil"), iter_tools, PREFS_PAGE_TOOLS_PENCIL);
     this->AddSelcueCheckbox(_page_pencil, "/tools/freehand/pencil", true);
     this->AddNewObjectsStyle(_page_pencil, "/tools/freehand/pencil");
+    this->AddDotSizeSpinbutton(_page_pencil, "/tools/freehand/pencil", 3.0);
     _page_pencil.add_group_header( _("Sketch mode"));
     _page_pencil.add_line( true, "", _pencil_average_all_sketches, "",
                             _("If on, the sketch result will be the normal average of all sketches made, instead of averaging the old result with the new sketch."));