From: Diederik van Lierop Date: Sun, 26 Sep 2010 17:25:58 +0000 (+0200) Subject: 3DBox tool: snap the first point of the drag action X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=66beae9e01de14ec79be8cf45ffb23c47ef7caf4;p=inkscape.git 3DBox tool: snap the first point of the drag action --- diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index 37e9e210c..8274ffde7 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -283,6 +283,7 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven if ( event->button.button == 1 && !event_context->space_panning) { Geom::Point const button_w(event->button.x, event->button.y); + Geom::Point button_dt(desktop->w2d(button_w)); // save drag origin event_context->xp = (gint) button_w[Geom::X]; @@ -294,8 +295,12 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven dragging = true; - /* */ - Geom::Point button_dt(desktop->w2d(button_w)); + SnapManager &m = desktop->namedview->snap_manager; + m.setup(desktop, true, bc->item); + m.freeSnapReturnByRef(button_dt, Inkscape::SNAPSOURCE_NODE_HANDLE); + m.unSetup(); + bc->center = from_2geom(button_dt); + bc->drag_origin = from_2geom(button_dt); bc->drag_ptB = from_2geom(button_dt); bc->drag_ptC = from_2geom(button_dt); @@ -313,13 +318,6 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven bc->drag_ptC_proj.normalize(); bc->drag_ptC_proj[Proj::Z] = 0.25; - /* Snap center */ - SnapManager &m = desktop->namedview->snap_manager; - m.setup(desktop, true, bc->item); - m.freeSnapReturnByRef(button_dt, Inkscape::SNAPSOURCE_NODE_HANDLE); - m.unSetup(); - bc->center = from_2geom(button_dt); - sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), ( GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |