summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b65a8fe)
raw | patch | inline | side by side (parent: b65a8fe)
author | Diederik van Lierop <mailat-signdiedenrezidotnl> | |
Sat, 25 Sep 2010 13:01:50 +0000 (15:01 +0200) | ||
committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | |
Sat, 25 Sep 2010 13:01:50 +0000 (15:01 +0200) |
src/vanishing-point.cpp | patch | blob | history |
index 78ceec4671178a2bf4fb33535d7f0137eeab7af4..5ee1582342f6950ab89e294352e3e11f26e82d32 100644 (file)
--- a/src/vanishing-point.cpp
+++ b/src/vanishing-point.cpp
#include "xml/repr.h"
#include "perspective-line.h"
#include "shape-editor.h"
+#include "snap.h"
+#include "sp-namedview.h"
namespace Box3D {
}
static void
-vp_knot_moved_handler (SPKnot */*knot*/, Geom::Point const *ppointer, guint state, gpointer data)
+vp_knot_moved_handler (SPKnot *knot, Geom::Point const *ppointer, guint state, gpointer data)
{
VPDragger *dragger = (VPDragger *) data;
VPDrag *drag = dragger->parent;
@@ -170,10 +172,20 @@ vp_knot_moved_handler (SPKnot */*knot*/, Geom::Point const *ppointer, guint stat
return;
}
}
- }
+ // We didn't snap to another dragger, so we'll try a regular snap
+ SPDesktop *desktop = inkscape_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();
+ sp_knot_moveto(knot, p);
+ }
+ }
- dragger->point = p; // FIXME: Brauchen wir dragger->point überhaupt?
+ dragger->point = p; // FIXME: Is dragger->point being used at all?
dragger->updateVPs(p);
dragger->updateBoxDisplays();