mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-28 03:37:00 -06:00
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:
co-authored by
Claude Opus 5.5
parent
059bd82676
commit
de17a00eb2
@@ -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}"))),
|
||||
|
||||
Reference in New Issue
Block a user