summaryrefslogtreecommitdiffstats
path: root/src/snapped-point.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/snapped-point.cpp')
-rw-r--r--src/snapped-point.cpp26
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();