M7/G4: retype float checks without negated comparisons (#4934)

This commit is contained in:
ruchirguitar
2026-11-18 02:48:38 +05:30
parent 75d9d61ce9
commit 957712ca71
+2 -2
View File
@@ -266,7 +266,7 @@ fn signature(path: &BezPath) -> Option<Signature> {
let lens: Vec<f64> = c.iter().map(|s| s.arclen(accuracy)).collect();
let len: f64 = lens.iter().sum();
// A contour with no length (a lone move) draws nothing.
if !(len > size * 1e-9) || !len.is_finite() {
if !len.is_finite() || len <= size * 1e-9 {
continue;
}
total += len;
@@ -292,7 +292,7 @@ fn signature(path: &BezPath) -> Option<Signature> {
*p = Point::new(p.x - centre.x, p.y - centre.y);
}
let spread = (pts.iter().map(|p| p.x * p.x + p.y * p.y).sum::<f64>() / n).sqrt();
if !(spread > 0.0) || !spread.is_finite() {
if !spread.is_finite() || spread <= 0.0 {
return None;
}
Some(Signature { contours: contours_n, pts, centre, spread, invariant: spread / total })