mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
style: keep paint.rs spot-colour chain under rustfmt's max width (#3940)
* style: wrap long spot-colour fallback chain to satisfy rustfmt * fix(brush): replace negated partial-ord comparison (clippy 1.99)
This commit is contained in:
@@ -181,7 +181,10 @@ fn color_within(r: &mut Reader, id: ObjId, depth: u32) -> Option<Color> {
|
|||||||
if depth >= MAX_SPOT_CHAIN {
|
if depth >= MAX_SPOT_CHAIN {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
return s.obj(id, b"srgb").and_then(|c| color_within(r, c, depth + 1)).or_else(|| s.obj(id, b"base").and_then(|c| color_within(r, c, depth + 1)));
|
return s
|
||||||
|
.obj(id, b"srgb")
|
||||||
|
.and_then(|c| color_within(r, c, depth + 1))
|
||||||
|
.or_else(|| s.obj(id, b"base").and_then(|c| color_within(r, c, depth + 1)));
|
||||||
}
|
}
|
||||||
b"RegC" => Color::Cmyk { c: 1.0, m: 1.0, y: 1.0, k: 1.0, a: 1.0 },
|
b"RegC" => Color::Cmyk { c: 1.0, m: 1.0, y: 1.0, k: 1.0, a: 1.0 },
|
||||||
_ => {
|
_ => {
|
||||||
|
|||||||
@@ -171,7 +171,9 @@ pub fn tracks(bp: &BezPath, tol: f64) -> Vec<Track> {
|
|||||||
// Far outside any drawing a curve flattens to millions of points; past a few million, the
|
// Far outside any drawing a curve flattens to millions of points; past a few million, the
|
||||||
// rest are not kept.
|
// rest are not kept.
|
||||||
let b = bp.control_box();
|
let b = bp.control_box();
|
||||||
if !(b.x0.abs().max(b.x1.abs()).max(b.y0.abs()).max(b.y1.abs()) <= 1e9) {
|
let extent = b.x0.abs().max(b.x1.abs()).max(b.y0.abs()).max(b.y1.abs());
|
||||||
|
// NaN coordinates must be rejected too, so keep the negation of the `<=` check.
|
||||||
|
if extent.is_nan() || extent > 1e9 {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
let mut els = vec![];
|
let mut els = vec![];
|
||||||
|
|||||||
Reference in New Issue
Block a user