summaryrefslogtreecommitdiffstats
path: root/src/object-snapper.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-03-14 13:35:53 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-03-14 13:35:53 +0000
commit2985b1cb4f0fef5f7bdc3ced9bffed5726d87df3 (patch)
tree8cf2bc230fcbc9722ac716d9c216decc0a8e8d19 /src/object-snapper.cpp
parentTexture filters Blotting paper, Burnt edges, Inkblot and Wax print improved f... (diff)
downloadinkscape-2985b1cb4f0fef5f7bdc3ced9bffed5726d87df3.tar.gz
inkscape-2985b1cb4f0fef5f7bdc3ced9bffed5726d87df3.zip
2Geom migration: use 2geom::projection instead of libnr's project_on_linesegment
(bzr r7487)
Diffstat (limited to 'src/object-snapper.cpp')
-rw-r--r--src/object-snapper.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 0223ee132..9a7053c4c 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -17,6 +17,7 @@
#include <2geom/path-intersection.h>
#include <2geom/point.h>
#include <2geom/rect.h>
+#include <2geom/line.h>
#include "document.h"
#include "sp-namedview.h"
#include "sp-image.h"
@@ -304,7 +305,7 @@ void Inkscape::ObjectSnapper::_snapTranslatingGuideToNodes(SnappedConstraints &s
for (std::vector<std::pair<Geom::Point, int> >::const_iterator k = _points_to_snap_to->begin(); k != _points_to_snap_to->end(); k++) {
// Project each node (*k) on the guide line (running through point p)
- Geom::Point p_proj = project_on_linesegment((*k).first, p, p + Geom::rot90(guide_normal));
+ Geom::Point p_proj = Geom::projection((*k).first, Geom::Line(p, p + Geom::rot90(guide_normal)));
Geom::Coord dist = Geom::L2((*k).first - p_proj); // distance from node to the guide
Geom::Coord dist2 = Geom::L2(p - p_proj); // distance from projection of node on the guide, to the mouse location
if ((dist < tol && dist2 < tol) || (getSnapperAlwaysSnap() && dist < s.getSnapDistance())) {
@@ -555,7 +556,7 @@ void Inkscape::ObjectSnapper::_snapPathsConstrained(SnappedConstraints &sc,
// The intersection point of the constraint line with any path,
// must lie within two points on the constraintline: p_min_on_cl and p_max_on_cl
// The distance between those points is twice the snapping tolerance
- Geom::Point const p_proj_on_cl = project_on_linesegment(p, p1_on_cl, p2_on_cl);
+ Geom::Point const p_proj_on_cl = Geom::projection(p, Geom::Line(p1_on_cl, p2_on_cl));
Geom::Point const p_min_on_cl = _snapmanager->getDesktop()->dt2doc(p_proj_on_cl - getSnapperTolerance() * direction_vector);
Geom::Point const p_max_on_cl = _snapmanager->getDesktop()->dt2doc(p_proj_on_cl + getSnapperTolerance() * direction_vector);