Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

Scribble: the row loop's stop compares with partial_cmp (also stops on NaN; clippy)

bflatastic028cafa52e24
diff --git a/crates/effects/src/stylize.rs b/crates/effects/src/stylize.rs
index 2079979b9..bdb5f8623 100644
--- a/crates/effects/src/stylize.rs
+++ b/crates/effects/src/stylize.rs
@@ -189,7 +189,7 @@ pub fn scribble(path: &PathData, b: Rect, p: &Value) -> PathData {
// would never move it.
while row <= 2001 {
let y = y0 + step / 2.0 + row as f64 * step;
- if !(y < y1) {
+ if y.partial_cmp(&y1) != Some(std::cmp::Ordering::Less) {
break;
}
let mut xs: Vec<f64> = vec![];