Code

Fix snap bug as reported by Arcadie Cracan on the developers mailing list, dating...
authorDiederik van Lierop <mailat-signdiedenrezidotnl>
Sat, 23 Jan 2010 13:58:50 +0000 (14:58 +0100)
committerDiederik van Lierop <mailat-signdiedenrezidotnl>
Sat, 23 Jan 2010 13:58:50 +0000 (14:58 +0100)
src/event-context.cpp
src/snap-enums.h

index 100e6b1430123126dfbf94c6466a90c4776feb58..5592741d9a525cd48d0258c76c0c4e523a660040 100644 (file)
@@ -934,25 +934,21 @@ gint sp_event_context_item_handler(SPEventContext * event_context,
         SPItem * item, GdkEvent * event) {
     switch (event->type) {
     case GDK_MOTION_NOTIFY:
-        sp_event_context_snap_delay_handler(event_context, item, NULL,
-                (GdkEventMotion *) event,
-                DelayedSnapEvent::EVENTCONTEXT_ITEM_HANDLER);
+        sp_event_context_snap_delay_handler(event_context, item, NULL, (GdkEventMotion *) event, DelayedSnapEvent::EVENTCONTEXT_ITEM_HANDLER);
         break;
     case GDK_BUTTON_RELEASE:
         if (event_context->_delayed_snap_event) {
             // If we have any pending snapping action, then invoke it now
-            sp_event_context_snap_watchdog_callback(
-                    event_context->_delayed_snap_event);
+            sp_event_context_snap_watchdog_callback(event_context->_delayed_snap_event);
         }
         break;
-        /*case GDK_BUTTON_PRESS:
-         case GDK_2BUTTON_PRESS:
-         case GDK_3BUTTON_PRESS:
-         // Snapping will be on hold if we're moving the mouse at high speeds. When starting
-         // drawing a new shape we really should snap though.
-         event_context->desktop->namedview->snap_manager.snapprefs.setSnapPostponedGlobally(false);
-         break;
-         */
+    case GDK_BUTTON_PRESS:
+    case GDK_2BUTTON_PRESS:
+    case GDK_3BUTTON_PRESS:
+        // Snapping will be on hold if we're moving the mouse at high speeds. When starting
+        // drawing a new shape we really should snap though.
+        event_context->desktop->namedview->snap_manager.snapprefs.setSnapPostponedGlobally(false);
+        break;
     default:
         break;
     }
index 41cc65abb2d6deb8ba40886df0d1a5879d0ad3c5..60893de6afa1b9fdae60e1c6a222479bc6d9e61f 100644 (file)
@@ -64,7 +64,7 @@ enum SnapSourceType {
     SNAPSOURCE_CORNER, // of image or of rectangle
     SNAPSOURCE_CONVEX_HULL_CORNER,
     SNAPSOURCE_ELLIPSE_QUADRANT_POINT,
-    SNAPSOURCE_NODE_HANDLE,
+    SNAPSOURCE_NODE_HANDLE, // eg. nodes in the path editor, handles of stars or rectangles, etc. (tied to a stroke)
     //-------------------------------------------------------------------
     // Other points (e.g. guides, gradient knots) will snap to both bounding boxes and nodes
     SNAPSOURCE_OTHER_CATEGORY = 1024, // will be used as a flag and must therefore be a power of two
@@ -74,7 +74,7 @@ enum SnapSourceType {
     SNAPSOURCE_GUIDE,
     SNAPSOURCE_GUIDE_ORIGIN,
     SNAPSOURCE_TEXT_BASELINE,
-    SNAPSOURCE_OTHER_HANDLE
+    SNAPSOURCE_OTHER_HANDLE // eg. the handle of a gradient of a connector (ie not being tied to a stroke)
 };
 
 }