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/snapped-line.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/snapped-line.cpp')
| -rw-r--r-- | src/snapped-line.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/snapped-line.cpp b/src/snapped-line.cpp index 663da2e8a..c507108ac 100644 --- a/src/snapped-line.cpp +++ b/src/snapped-line.cpp @@ -9,7 +9,7 @@ */ #include "snapped-line.h" -#include "geom.h" +#include <2geom/geom.h> #include "libnr/nr-values.h" Inkscape::SnappedLineSegment::SnappedLineSegment(NR::Point snapped_point, NR::Coord snapped_distance, NR::Point start_point_of_line, NR::Point end_point_of_line) @@ -81,13 +81,14 @@ Inkscape::SnappedPoint Inkscape::SnappedLine::intersect(SnappedLine const &line) // Calculate the intersection of to lines, which are both within snapping range // The point of intersection should be considered for snapping, but might be outside the snapping range - NR::Point intersection = NR::Point(NR_HUGE, NR_HUGE); + Geom::Point intersection_2geom(NR_HUGE, NR_HUGE); NR::Coord distance = NR_HUGE; - IntersectorKind result = intersector_line_intersection(getNormal(), getConstTerm(), - line.getNormal(), line.getConstTerm(), intersection); + Geom::IntersectorKind result = Geom::line_intersection(getNormal().to_2geom(), getConstTerm(), + line.getNormal().to_2geom(), line.getConstTerm(), intersection_2geom); + NR::Point intersection(intersection_2geom); - if (result == INTERSECTS) { + if (result == Geom::intersects) { /* The relevant snapped distance is the distance to the closest snapped line, not the distance to the intersection. For example, when a box is almost aligned with a grid in both horizontal and vertical directions, the distance to the intersection of the @@ -99,8 +100,8 @@ Inkscape::SnappedPoint Inkscape::SnappedLine::intersect(SnappedLine const &line) distance = std::min(_distance, line.getDistance()); //std::cout << "Intersected nicely, now getSIL distance = " << distance << std::endl; } - - return SnappedPoint(intersection, distance, result == INTERSECTS); + + return SnappedPoint(intersection, distance, result == Geom::intersects); } // search for the closest snapped line |
