Add a log warning for NaN paths
diff --git a/Cargo.lock b/Cargo.lock index fdcb551..ca6c0fa 100644 --- a/Cargo.lock +++ b/Cargo.lock
@@ -3717,6 +3717,7 @@ "bytemuck", "fearless_simd", "libm", + "log", "peniko", "png", "roxmltree",
diff --git a/sparse_strips/vello_common/Cargo.toml b/sparse_strips/vello_common/Cargo.toml index caf7121..1d6a9ab 100644 --- a/sparse_strips/vello_common/Cargo.toml +++ b/sparse_strips/vello_common/Cargo.toml
@@ -25,6 +25,7 @@ skrifa = { workspace = true, optional = true } smallvec = { workspace = true } libm = { version = "0.2.15", optional = true } +log = { workspace = true } [features] default = ["std", "png", "text"]
diff --git a/sparse_strips/vello_common/src/flatten.rs b/sparse_strips/vello_common/src/flatten.rs index f026cbc..8356a84 100644 --- a/sparse_strips/vello_common/src/flatten.rs +++ b/sparse_strips/vello_common/src/flatten.rs
@@ -5,6 +5,7 @@ use crate::kurbo::{self, Affine, BezPath, PathEl, Stroke, StrokeOpts}; use alloc::vec::Vec; +use log::warn; /// The flattening tolerance. const TOL: f64 = 0.25; @@ -114,6 +115,8 @@ // A path that contains NaN is ill-defined, so ignore it. if is_nan { + warn!("A path contains NaN, ignoring it."); + line_buf.clear(); } }