diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-11-09 23:15:51 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-11-09 23:15:51 +0000 |
| commit | e74f90ca3ce8c75e84d48b66a8a4e594c415b541 (patch) | |
| tree | e306ccc400c5ed90995bd9130f3ddf0c55a17fe5 /src/line-snapper.cpp | |
| parent | allow for _option in radiobuttons for XML translation (diff) | |
| download | inkscape-e74f90ca3ce8c75e84d48b66a8a4e594c415b541.tar.gz inkscape-e74f90ca3ce8c75e84d48b66a8a4e594c415b541.zip | |
Remove geom.cpp and geom.h. Now use 2geom/geom.cpp and 2geom.h.
Add conversion functions between Geom::Point and NR::Point
(bzr r4050)
Diffstat (limited to 'src/line-snapper.cpp')
| -rw-r--r-- | src/line-snapper.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index f0ca38e3a..b0dcca22c 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -1,6 +1,6 @@ #include "libnr/nr-values.h" #include "libnr/nr-point-fns.h" -#include "geom.h" +#include <2geom/geom.h> #include "line-snapper.h" #include "snapped-line.cpp" @@ -48,10 +48,11 @@ void Inkscape::LineSnapper::_doConstrainedSnap(SnappedConstraints &sc, NR::Coord const q = dot(n, point_on_line); /* Try to intersect this line with the target line */ - NR::Point t = NR::Point(NR_HUGE, NR_HUGE); - IntersectorKind const k = intersector_line_intersection(n, q, component_vectors[i->first], i->second, t); - - if (k == INTERSECTS) { + Geom::Point t_2geom(NR_HUGE, NR_HUGE); + Geom::IntersectorKind const k = Geom::line_intersection(n.to_2geom(), q, component_vectors[i->first].to_2geom(), i->second, t_2geom); + NR::Point t(t_2geom); + + if (k == Geom::intersects) { const NR::Coord dist = L2(t - p); //Store any line that's within snapping range if (dist < getDistance()) { |
