summaryrefslogtreecommitdiffstats
path: root/src/vanishing-point.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2015-07-24 20:16:07 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2015-07-24 20:16:07 +0000
commit1867f123d5c52008738a2873abda555d3bd882f3 (patch)
tree21a8c8e19240f967b11b775541e85d38c68ee4ce /src/vanishing-point.cpp
parentMake persistence of snap indicator configurable, and clean up the snapping ta... (diff)
downloadinkscape-1867f123d5c52008738a2873abda555d3bd882f3.tar.gz
inkscape-1867f123d5c52008738a2873abda555d3bd882f3.zip
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)
Diffstat (limited to '')
-rw-r--r--src/vanishing-point.cpp30
1 files changed, 16 insertions, 14 deletions
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<SPItem*> sel = selection->itemList();
+ std::vector<SPItem*> sel = selection->itemList();
if (sel.empty())
return; // no selection