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/box3d-context.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/box3d-context.cpp') diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index ca6822dda..a7cead93e 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -332,7 +332,8 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven /* Snap center */ SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop, bc->item); - bc->center = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, button_dt).getPoint(); + m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, button_dt); + bc->center = button_dt; sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), ( GDK_KEY_PRESS_MASK | @@ -363,7 +364,7 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop, bc->item); - motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt).getPoint(); + m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt); bc->ctrl_dragged = event->motion.state & GDK_CONTROL_MASK; @@ -396,7 +397,7 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven bc->drag_ptB_proj.normalize(); bc->drag_ptC_proj = cur_persp->tmat.preimage (motion_dt, bc->drag_ptB_proj[Proj::X], Proj::X); } - bc->drag_ptC = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, bc->drag_ptC).getPoint(); + m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, bc->drag_ptC); } sp_box3d_drag(*bc, event->motion.state); -- cgit v1.2.3