Review #987: test the next-object stroke with nothing selected; rustfmt

A rejected Stroke panel edit with nothing selected leaves the next
object's stroke as it was; an accepted one sets its weight and dashes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-11 01:46:22 +07:00
co-authored by Claude Opus 5.5
parent 059bd82676
commit de17a00eb2
2 changed files with 12 additions and 5 deletions
+2 -4
View File
@@ -102,10 +102,8 @@ impl StrokeChange {
Some(Value::Null) => Some(None),
Some(Value::Array(a)) => {
// Do not silently omit malformed segments and change the user's dash pattern.
let values: Vec<f64> = a
.iter()
.map(|v| v.as_f64().ok_or_else(|| bad(cmd, format!("dash lengths must be numbers, got {v}"))))
.collect::<Result<_>>()?;
let values: Vec<f64> =
a.iter().map(|v| v.as_f64().ok_or_else(|| bad(cmd, format!("dash lengths must be numbers, got {v}")))).collect::<Result<_>>()?;
Some(Some(values).filter(|d| !d.is_empty()))
}
Some(v) => return Err(bad(cmd, format!("dash must be a list of lengths or null, got {v}"))),