Code

Do not append a segment when finishing an open path with right click
authorKrzysztof Kosiński <tweenk.pl@gmail.com>
Thu, 14 Jan 2010 09:31:02 +0000 (10:31 +0100)
committerKrzysztof Kosiński <tweenk.pl@gmail.com>
Thu, 14 Jan 2010 09:31:02 +0000 (10:31 +0100)
in the pen tool.

src/pen-context.cpp

index 1447173320c6cfd0b8b578eb168d65b23a824637..a717537abc6f42c390f9b6ab12ab38726b357804 100644 (file)
@@ -557,20 +557,22 @@ static gint pen_handle_button_press(SPPenContext *const pc, GdkEventButton const
             default:
                 break;
         }
-    } else if (bevent.button == 3 || pc->expecting_clicks_for_LPE == 1) { // when the last click for a waiting LPE occurs we want to finish the path
-        if (pc->npoints != 0) {
-
-            spdc_pen_finish_segment(pc, event_dt, bevent.state);
-            if (pc->green_closed) {
-                // finishing at the start anchor, close curve
-                spdc_pen_finish(pc, TRUE);
-            } else {
-                // finishing at some other anchor, finish curve but not close
-                spdc_pen_finish(pc, FALSE);
-            }
-
-            ret = TRUE;
+    } else if (pc->expecting_clicks_for_LPE == 1 && pc->npoints != 0) {
+        // when the last click for a waiting LPE occurs we want to finish the path
+        spdc_pen_finish_segment(pc, event_dt, bevent.state);
+        if (pc->green_closed) {
+            // finishing at the start anchor, close curve
+            spdc_pen_finish(pc, TRUE);
+        } else {
+            // finishing at some other anchor, finish curve but not close
+            spdc_pen_finish(pc, FALSE);
         }
+
+        ret = TRUE;
+    } else if (bevent.button == 3 && pc->npoints != 0) {
+        // right click - finish path
+        spdc_pen_finish(pc, FALSE);
+        ret = TRUE;
     }
 
     if (pc->expecting_clicks_for_LPE > 0) {