From b0bda995cebf5befd80a735796661fb670eca179 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 5 May 2006 14:22:41 +0000 Subject: Various snapping cleanups and bug fixes. (bzr r734) --- src/line-snapper.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/line-snapper.cpp') diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index 383c1fb96..a2c6b944b 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -35,23 +35,21 @@ Inkscape::SnappedPoint Inkscape::LineSnapper::_doFreeSnap(NR::Point const &p, } Inkscape::SnappedPoint Inkscape::LineSnapper::_doConstrainedSnap(NR::Point const &p, - NR::Point const &c, + ConstraintLine const &c, std::list const &it) const { Inkscape::SnappedPoint s = SnappedPoint(p, NR_HUGE); - NR::Point const v = NR::unit_vector(c); - /* Get the lines that we will try to snap to */ const LineList lines = _getSnapLines(p); for (LineList::const_iterator i = lines.begin(); i != lines.end(); i++) { /* Normal to the line we're trying to snap along */ - NR::Point const n(NR::rot90(v)); + NR::Point const n(NR::rot90(NR::unit_vector(c.getDirection()))); - /* Hence constant term of the line we're trying to snap along */ - NR::Coord const q = dot(n, p); + /* Constant term of the line we're trying to snap along */ + NR::Coord const q = dot(n, c.hasPoint() ? c.getPoint() : p); /* Try to intersect this line with the target line */ NR::Point t = p; -- cgit v1.2.3