summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-01-23 13:58:50 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-01-23 13:58:50 +0000
commit1c194ccaa8bf976aba4cc2dc326d39c33b4c0a7c (patch)
treee31a20079a8987735c89b712c89ba4c23271b8af /src
parentRemove redundancy from snapping API (type of snapsource no longer has to be s... (diff)
downloadinkscape-1c194ccaa8bf976aba4cc2dc326d39c33b4c0a7c.tar.gz
inkscape-1c194ccaa8bf976aba4cc2dc326d39c33b4c0a7c.zip
Fix snap bug as reported by Arcadie Cracan on the developers mailing list, dating 2009-10-28
(bzr r9015)
Diffstat (limited to 'src')
-rw-r--r--src/event-context.cpp22
-rw-r--r--src/snap-enums.h4
2 files changed, 11 insertions, 15 deletions
diff --git a/src/event-context.cpp b/src/event-context.cpp
index 100e6b143..5592741d9 100644
--- a/src/event-context.cpp
+++ b/src/event-context.cpp
@@ -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;
}
diff --git a/src/snap-enums.h b/src/snap-enums.h
index 41cc65abb..60893de6a 100644
--- a/src/snap-enums.h
+++ b/src/snap-enums.h
@@ -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)
};
}