Code

fix by Preben S for LP bug 389780, flatness
[inkscape.git] / src / pen-context.cpp
index d0889b4ec3a0cefa7ba9d8cde54926efea917e0d..261c7d4cf69276e37348c3f1eea0b20391c0c487 100644 (file)
@@ -208,8 +208,6 @@ sp_pen_context_setup(SPEventContext *ec)
 
     pc = SP_PEN_CONTEXT(ec);
 
-    sp_canvas_set_snap_delay_active(pc->desktop->canvas, true);
-
     if (((SPEventContextClass *) pen_parent_class)->setup) {
         ((SPEventContextClass *) pen_parent_class)->setup(ec);
     }
@@ -265,7 +263,7 @@ sp_pen_context_finish(SPEventContext *ec)
 {
     SPPenContext *pc = SP_PEN_CONTEXT(ec);
 
-    sp_canvas_set_snap_delay_active(pc->desktop->canvas, false);
+    sp_event_context_snap_window_closed(ec, false); //TODO: Detailed implementation of the snap window; now it's simply always open
 
     if (pc->npoints != 0) {
         pen_cancel (pc);
@@ -369,6 +367,8 @@ sp_pen_context_root_handler(SPEventContext *ec, GdkEvent *event)
 {
     SPPenContext *const pc = SP_PEN_CONTEXT(ec);
 
+    sp_event_context_snap_window_open(ec, false); //TODO: Detailed implementation of the snap window; now it's simply always open
+
     gint ret = FALSE;
 
     switch (event->type) {
@@ -476,7 +476,7 @@ static gint pen_handle_button_press(SPPenContext *const pc, GdkEventButton const
                                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;
@@ -852,7 +852,8 @@ static gint
 pen_handle_2button_press(SPPenContext *const pc, GdkEventButton const &bevent)
 {
     gint ret = FALSE;
-    if (pc->npoints != 0 && bevent.button != 2) {
+    // only end on LMB double click. Otherwise horizontal scrolling causes ending of the path
+    if (pc->npoints != 0 && bevent.button == 1) {
         spdc_pen_finish(pc, FALSE);
         ret = TRUE;
     }
@@ -1041,6 +1042,7 @@ pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
             }
             break;
 
+/* TODO: this is not yet enabled?? looks like some traces of the Geometry tool
         case GDK_P:
         case GDK_p:
             if (MOD__SHIFT_ONLY) {
@@ -1072,6 +1074,7 @@ pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
                 ret = TRUE;
             }
             break;
+*/
 
         case GDK_U:
         case GDK_u: