diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2008-09-21 20:18:04 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2008-09-21 20:18:04 +0000 |
| commit | 745fa4a5aab9b699415a7278e6dda37ba181ace0 (patch) | |
| tree | 52d64e0a6177d2d8fae19af6e67262190dace9a1 /src/snapped-line.cpp | |
| parent | fix crash: connections were not disconnected on destruction (diff) | |
| download | inkscape-745fa4a5aab9b699415a7278e6dda37ba181ace0.tar.gz inkscape-745fa4a5aab9b699415a7278e6dda37ba181ace0.zip | |
- refactor snapping code, removing code duplication
- fix snapping to page corners
(bzr r6863)
Diffstat (limited to 'src/snapped-line.cpp')
| -rw-r--r-- | src/snapped-line.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/snapped-line.cpp b/src/snapped-line.cpp index f35c7a81c..fc2d059dc 100644 --- a/src/snapped-line.cpp +++ b/src/snapped-line.cpp @@ -67,12 +67,12 @@ Inkscape::SnappedPoint Inkscape::SnappedLineSegment::intersect(SnappedLineSegmen bool const use_this_as_primary = c1 || c2; Inkscape::SnappedLineSegment const *primarySLS = use_this_as_primary ? this : &line; Inkscape::SnappedLineSegment const *secondarySLS = use_this_as_primary ? &line : this; - return SnappedPoint(intersection, SNAPTARGET_PATH_INTERSECTION, primarySLS->getDistance(), primarySLS->getTolerance(), primarySLS->getAlwaysSnap(), true, + return SnappedPoint(intersection, SNAPTARGET_PATH_INTERSECTION, primarySLS->getDistance(), primarySLS->getTolerance(), primarySLS->getAlwaysSnap(), true, true, secondarySLS->getDistance(), secondarySLS->getTolerance(), secondarySLS->getAlwaysSnap()); } // No intersection - return SnappedPoint(intersection, SNAPTARGET_UNDEFINED, NR_HUGE, 0, false, false, NR_HUGE, 0, false); + return SnappedPoint(intersection, SNAPTARGET_UNDEFINED, NR_HUGE, 0, false, false, false, NR_HUGE, 0, false); }; @@ -142,14 +142,14 @@ Inkscape::SnappedPoint Inkscape::SnappedLine::intersect(SnappedLine const &line) bool const use_this_as_primary = c1 || c2; Inkscape::SnappedLine const *primarySL = use_this_as_primary ? this : &line; Inkscape::SnappedLine const *secondarySL = use_this_as_primary ? &line : this; - return SnappedPoint(intersection, Inkscape::SNAPTARGET_UNDEFINED, primarySL->getDistance(), primarySL->getTolerance(), primarySL->getAlwaysSnap(), true, + return SnappedPoint(intersection, Inkscape::SNAPTARGET_UNDEFINED, primarySL->getDistance(), primarySL->getTolerance(), primarySL->getAlwaysSnap(), true, true, secondarySL->getDistance(), secondarySL->getTolerance(), secondarySL->getAlwaysSnap()); // The type of the snap target is yet undefined, as we cannot tell whether // we're snapping to grid or the guide lines; must be set by on a higher level } // No intersection - return SnappedPoint(intersection, SNAPTARGET_UNDEFINED, NR_HUGE, 0, false, false, NR_HUGE, 0, false); + return SnappedPoint(intersection, SNAPTARGET_UNDEFINED, NR_HUGE, 0, false, false, false, NR_HUGE, 0, false); } // search for the closest snapped line segment |
