From 5caa096fb1cff5a744442aaa9b74dd644a243e02 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 18 Mar 2007 09:12:01 +0000 Subject: Implement snapping in shape-tools during initial-drawing (bzr r2690) --- src/spiral-context.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/spiral-context.cpp') diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp index 2e4214f06..ef3e3470b 100644 --- a/src/spiral-context.cpp +++ b/src/spiral-context.cpp @@ -264,7 +264,7 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event) sc->center = Inkscape::setup_for_drag_start(desktop, event_context, event); SnapManager const &m = desktop->namedview->snap_manager; - sc->center = m.freeSnap(Inkscape::Snapper::SNAP_POINT, sc->center, sc->item).getPoint(); + sc->center = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, sc->center, sc->item).getPoint(); sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), ( GDK_KEY_PRESS_MASK | @@ -289,7 +289,11 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event) event_context->within_tolerance = false; NR::Point const motion_w(event->motion.x, event->motion.y); - NR::Point const motion_dt(event_context->desktop->w2d(motion_w)); + NR::Point motion_dt(event_context->desktop->w2d(motion_w)); + + SnapManager const &m = desktop->namedview->snap_manager; + motion_dt = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, motion_dt, sc->item).getPoint(); + sp_spiral_drag(sc, motion_dt, event->motion.state); ret = TRUE; } -- cgit v1.2.3