From e74a931621c52dd8f029c19494f48379040f2165 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sat, 24 Feb 2007 21:29:58 +0000 Subject: [PATCH] patch 1665648 by Diederik to snap to grid when drawing rectangles --- src/rect-context.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rect-context.cpp b/src/rect-context.cpp index 82eef51e7..8482cd042 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -327,8 +327,13 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent NR::Point const motion_w(event->motion.x, event->motion.y); - NR::Point const motion_dt(desktop->w2d(motion_w)); + NR::Point motion_dt(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, NULL).getPoint(); + sp_rect_drag(*rc, motion_dt, event->motion.state); + ret = TRUE; } break; -- 2.30.2