summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2007-12-27 19:45:52 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2007-12-27 19:45:52 +0000
commitef2e57886d26946690d4f98db587fc6cd3ec615a (patch)
tree5e5eab0d2c866db21ca926101991298be0c85501 /src/snap.cpp
parentfixed bad markup in translation (diff)
downloadinkscape-ef2e57886d26946690d4f98db587fc6cd3ec615a.tar.gz
inkscape-ef2e57886d26946690d4f98db587fc6cd3ec615a.zip
Snapping a guide to nodes (while dragging it across the canvas) now also works for angled guides
(bzr r4321)
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index b4e284271..c6fa3fc25 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -285,29 +285,16 @@ Inkscape::SnappedPoint SnapManager::constrainedSnap(Inkscape::Snapper::PointType
}
Inkscape::SnappedPoint SnapManager::guideSnap(NR::Point const &p,
- NR::Point const &guide_normal) const
+ NR::Point const &guide_normal) const
{
- if (!object.ThisSnapperMightSnap()) {
- return Inkscape::SnappedPoint(p, NR_HUGE);
- }
-
// This method is used to snap a guide to nodes, while dragging the guide around
- Inkscape::ObjectSnapper::DimensionToSnap snap_dim;
- if (guide_normal == component_vectors[NR::Y]) {
- snap_dim = Inkscape::ObjectSnapper::SNAP_Y;
- } else if (guide_normal == component_vectors[NR::X]) {
- snap_dim = Inkscape::ObjectSnapper::SNAP_X;
- } else {
- g_warning("WARNING: snapping of angled guides is not supported yet!");
- // this is because _snapnodes, called in object.guideSnap, cannot only handle
- // vertical or horizontal lines for now....
- // Rotating an agled guide will require some additional code, as it would be great to
- // have it rotate around a snapped point
- snap_dim = Inkscape::ObjectSnapper::SNAP_XY;
+
+ if (!(object.ThisSnapperMightSnap() && _snap_enabled_globally)) {
+ return Inkscape::SnappedPoint(p, NR_HUGE);
}
SnappedConstraints sc;
- object.guideSnap(sc, p, snap_dim);
+ object.guideSnap(sc, p, guide_normal);
return findBestSnap(p, sc, false);
}