summaryrefslogtreecommitdiffstats
path: root/src/rect-context.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-05-20 19:21:01 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-05-20 19:21:01 +0000
commit72263c6e119314997999ce5014f1e915077b3c78 (patch)
treeb25fbb4b50d36590d1224fdde3fc6326182f5cc9 /src/rect-context.cpp
parentSet of (cxx)tests for svg-path.cpp and PathString. Not (yet) part of make check. (diff)
downloadinkscape-72263c6e119314997999ce5014f1e915077b3c78.tar.gz
inkscape-72263c6e119314997999ce5014f1e915077b3c78.zip
Improve snapping behaviour when creating new shapes
(bzr r5721)
Diffstat (limited to 'src/rect-context.cpp')
-rw-r--r--src/rect-context.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rect-context.cpp b/src/rect-context.cpp
index d1e5fe381..f53a39948 100644
--- a/src/rect-context.cpp
+++ b/src/rect-context.cpp
@@ -304,6 +304,11 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
NR::Point const button_dt(desktop->w2d(button_w));
rc->center = button_dt;
+ /* Snap center */
+ SnapManager &m = desktop->namedview->snap_manager;
+ m.setup(desktop, NULL); //null, because we don't have an item yet
+ m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, rc->center);
+
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
( GDK_KEY_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
@@ -491,11 +496,6 @@ static void sp_rect_drag(SPRectContext &rc, NR::Point const pt, guint state)
rc.item->updateRepr();
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
-
- /* Snap center */
- SnapManager &m = desktop->namedview->snap_manager;
- m.setup(desktop, rc.item);
- m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, rc.center);
}
NR::Rect const r = Inkscape::snap_rectangular_box(desktop, rc.item, pt, rc.center, state);