diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-08-05 00:49:51 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-08-05 00:49:51 +0000 |
| commit | 77dc5f1acd4a6b66b2d6fc5c81f7e5c61ef95785 (patch) | |
| tree | 15c3b32afa8a124f69644c8bd279dd361680974e /src/snapped-point.cpp | |
| parent | Wholesale cruft removal part 3 (diff) | |
| download | inkscape-77dc5f1acd4a6b66b2d6fc5c81f7e5c61ef95785.tar.gz inkscape-77dc5f1acd4a6b66b2d6fc5c81f7e5c61ef95785.zip | |
Wholesale cruft removal part 4; fix crash when rendering guides
(bzr r9508.1.48)
Diffstat (limited to 'src/snapped-point.cpp')
| -rw-r--r-- | src/snapped-point.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/snapped-point.cpp b/src/snapped-point.cpp index 48efa10e6..29e094a7c 100644 --- a/src/snapped-point.cpp +++ b/src/snapped-point.cpp @@ -21,11 +21,11 @@ Inkscape::SnappedPoint::SnappedPoint(Geom::Point const &p, SnapSourceType const _at_intersection = false; _constrained_snap = constrained_snap; _fully_constrained = fully_constrained; - _second_distance = NR_HUGE; + _second_distance = Geom::infinity(); _second_tolerance = 1; _second_always_snap = false; _transformation = Geom::Point(1,1); - _pointer_distance = NR_HUGE; + _pointer_distance = Geom::infinity(); } Inkscape::SnappedPoint::SnappedPoint(Inkscape::SnapCandidatePoint const &p, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained) @@ -37,11 +37,11 @@ Inkscape::SnappedPoint::SnappedPoint(Inkscape::SnapCandidatePoint const &p, Snap _at_intersection = false; _constrained_snap = constrained_snap; _fully_constrained = fully_constrained; - _second_distance = NR_HUGE; + _second_distance = Geom::infinity(); _second_tolerance = 1; _second_always_snap = false; _transformation = Geom::Point(1,1); - _pointer_distance = NR_HUGE; + _pointer_distance = Geom::infinity(); _target_bbox = p.getTargetBBox(); } @@ -53,7 +53,7 @@ Inkscape::SnappedPoint::SnappedPoint(Geom::Point const &p, SnapSourceType const // tolerance should never be smaller than 1 px, as it is used for normalization in // isOtherSnapBetter. We don't want a division by zero. _transformation = Geom::Point(1,1); - _pointer_distance = NR_HUGE; + _pointer_distance = Geom::infinity(); _target_bbox = Geom::OptRect(); } @@ -66,14 +66,14 @@ Inkscape::SnappedPoint::SnappedPoint() _at_intersection = false; _constrained_snap = false; _fully_constrained = false; - _distance = NR_HUGE; + _distance = Geom::infinity(); _tolerance = 1; _always_snap = false; - _second_distance = NR_HUGE; + _second_distance = Geom::infinity(); _second_tolerance = 1; _second_always_snap = false; _transformation = Geom::Point(1,1); - _pointer_distance = NR_HUGE; + _pointer_distance = Geom::infinity(); _target_bbox = Geom::OptRect(); } @@ -85,14 +85,14 @@ Inkscape::SnappedPoint::SnappedPoint(Geom::Point const &p) _target = SNAPTARGET_UNDEFINED, _at_intersection = false; _fully_constrained = false; - _distance = NR_HUGE; + _distance = Geom::infinity(); _tolerance = 1; _always_snap = false; - _second_distance = NR_HUGE; + _second_distance = Geom::infinity(); _second_tolerance = 1; _second_always_snap = false; _transformation = Geom::Point(1,1); - _pointer_distance = NR_HUGE; + _pointer_distance = Geom::infinity(); _target_bbox = Geom::OptRect(); } @@ -152,7 +152,7 @@ bool Inkscape::SnappedPoint::isOtherSnapBetter(Inkscape::SnappedPoint const &oth // When accounting for the distance to the mouse pointer, then at least one of the snapped points should // have that distance set. If not, then this is a bug. Either "weighted" must be set to false, or the // mouse pointer distance must be set. - g_assert(dist_pointer_this != NR_HUGE || dist_pointer_other != NR_HUGE); + g_assert(dist_pointer_this != Geom::infinity() || dist_pointer_other != Geom::infinity()); // The snap distance will always be smaller than the tolerance set for the snapper. The pointer distance can // however be very large. To compare these in a fair way, we will have to normalize these metrics first // The closest pointer distance will be normalized to 1.0; the other one will be > 1.0 @@ -195,7 +195,7 @@ bool Inkscape::SnappedPoint::isOtherSnapBetter(Inkscape::SnappedPoint const &oth // or, if it's just as close then consider the second distance ... bool c5a = (dist_other == dist_this); - bool c5b = (other_one.getSecondSnapDistance() < getSecondSnapDistance()) && (getSecondSnapDistance() < NR_HUGE); + bool c5b = (other_one.getSecondSnapDistance() < getSecondSnapDistance()) && (getSecondSnapDistance() < Geom::infinity()); // ... or prefer free snaps over constrained snaps bool c5c = !other_one.getConstrainedSnap() && getConstrainedSnap(); |
