diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-02-24 21:29:58 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-02-24 21:29:58 +0000 |
| commit | 8377225be07486467e531cff15677076bf4285c9 (patch) | |
| tree | 1f657074bbc85bc88c06c1f466cc2489f15c968b /src/rect-context.cpp | |
| parent | fix 1666532 (diff) | |
| download | inkscape-8377225be07486467e531cff15677076bf4285c9.tar.gz inkscape-8377225be07486467e531cff15677076bf4285c9.zip | |
patch 1665648 by Diederik to snap to grid when drawing rectangles
(bzr r2428)
Diffstat (limited to 'src/rect-context.cpp')
| -rw-r--r-- | src/rect-context.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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; |
