From de27d953d1c13d2e7563b43c2d959b1b02aee9c3 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Mon, 12 May 2008 18:58:04 +0000 Subject: Add a centralized check (i.e. in the snapper mechanism) whether we've snapped or not, instead of leaving it up to the various tools. This should prevent these tools from moving to (0,0) if they bluntly use the value returned by the snapping mechanism without checking whether snapping has really occured. (bzr r5659) --- src/rect-context.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/rect-context.cpp') diff --git a/src/rect-context.cpp b/src/rect-context.cpp index ad383b014..b8047b201 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -306,8 +306,8 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent /* Snap center */ SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop, rc->item); - Inkscape::SnappedPoint s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, button_dt); - rc->center = s.getPoint(); + m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, button_dt); + rc->center = button_dt; sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), ( GDK_KEY_PRESS_MASK | @@ -338,8 +338,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop, rc->item); - Inkscape::SnappedPoint s = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt); - motion_dt = s.getPoint(); + m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt); sp_rect_drag(*rc, motion_dt, event->motion.state); gobble_motion_events(GDK_BUTTON1_MASK); -- cgit v1.2.3