summaryrefslogtreecommitdiffstats
path: root/src/arc-context.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2007-03-18 09:12:01 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2007-03-18 09:12:01 +0000
commit5caa096fb1cff5a744442aaa9b74dd644a243e02 (patch)
tree8a8db608984c6a41fce66bff13d7df641f7173a3 /src/arc-context.cpp
parentmove masks to their own page, move tablet checkbox to mouse, copyedit (diff)
downloadinkscape-5caa096fb1cff5a744442aaa9b74dd644a243e02.tar.gz
inkscape-5caa096fb1cff5a744442aaa9b74dd644a243e02.zip
Implement snapping in shape-tools during initial-drawing
(bzr r2690)
Diffstat (limited to 'src/arc-context.cpp')
-rw-r--r--src/arc-context.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index c682677a6..1071d6f5d 100644
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
@@ -263,8 +263,9 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
dragging = true;
ac->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
- SnapManager const &m = desktop->namedview->snap_manager;
- ac->center = m.freeSnap(Inkscape::Snapper::SNAP_POINT, ac->center, ac->item).getPoint();
+ SnapManager const &m = desktop->namedview->snap_manager;
+ ac->center = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, ac->center, ac->item).getPoint();
+
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK,
@@ -286,7 +287,12 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
event_context->within_tolerance = false;
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, ac->item).getPoint();
+
+
sp_arc_drag(ac, motion_dt, event->motion.state);
ret = TRUE;
}