From 1867f123d5c52008738a2873abda555d3bd882f3 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 24 Jul 2015 22:16:07 +0200 Subject: 3D box tool: the shift key must not prevent snapping of the vanishing point. It must only serve to separate the vanishing points, in case of multiple boxes sharing the same vanishing points Fixed bugs: - https://launchpad.net/bugs/1460415 (bzr r14254) --- src/vanishing-point.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/vanishing-point.cpp') diff --git a/src/vanishing-point.cpp b/src/vanishing-point.cpp index 46f895c06..553e3a31d 100644 --- a/src/vanishing-point.cpp +++ b/src/vanishing-point.cpp @@ -130,7 +130,7 @@ vp_knot_moved_handler (SPKnot *knot, Geom::Point const &ppointer, guint state, g // FIXME: Do we need to create a new dragger as well? dragger->updateZOrders (); DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), SP_VERB_CONTEXT_3DBOX, - _("Split vanishing points")); + _("Split vanishing points")); return; } } @@ -175,22 +175,24 @@ vp_knot_moved_handler (SPKnot *knot, Geom::Point const &ppointer, guint state, g // as is currently the case. DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), SP_VERB_CONTEXT_3DBOX, - _("Merge vanishing points")); + _("Merge vanishing points")); return; } } + } - // We didn't snap to another dragger, so we'll try a regular snap - SPDesktop *desktop = SP_ACTIVE_DESKTOP; - SnapManager &m = desktop->namedview->snap_manager; - m.setup(desktop); - Inkscape::SnappedPoint s = m.freeSnap(Inkscape::SnapCandidatePoint(p, Inkscape::SNAPSOURCE_OTHER_HANDLE)); - m.unSetup(); - if (s.getSnapped()) { - p = s.getPoint(); - knot->moveto(p); - } + // We didn't hit the return statement above, so we didn't snap to another dragger. Therefore we'll now try a regular snap + // Regardless of the status of the SHIFT key, we will try to snap; Here SHIFT does not disable snapping, as the shift key + // has a different purpose in this context (see above) + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + SnapManager &m = desktop->namedview->snap_manager; + m.setup(desktop); + Inkscape::SnappedPoint s = m.freeSnap(Inkscape::SnapCandidatePoint(p, Inkscape::SNAPSOURCE_OTHER_HANDLE)); + m.unSetup(); + if (s.getSnapped()) { + p = s.getPoint(); + knot->moveto(p); } dragger->point = p; // FIXME: Is dragger->point being used at all? @@ -241,7 +243,7 @@ vp_knot_ungrabbed_handler (SPKnot *knot, guint /*state*/, gpointer data) g_return_if_fail (dragger->parent); g_return_if_fail (dragger->parent->document); DocumentUndo::done(dragger->parent->document, SP_VERB_CONTEXT_3DBOX, - _("3D box: Move vanishing point")); + _("3D box: Move vanishing point")); } unsigned int VanishingPoint::global_counter = 0; @@ -630,7 +632,7 @@ VPDrag::updateBoxHandles () // FIXME: Is there a way to update the knots without accessing the // (previously) statically linked function KnotHolder::update_knots? - std::vector sel = selection->itemList(); + std::vector sel = selection->itemList(); if (sel.empty()) return; // no selection -- cgit v1.2.3