Merge pull request #6550 from dotCooCoo/fix/reshape-empty-focal-radius

Reshape: an empty focal list cannot be combined with radius
This commit is contained in:
BFlat
2026-11-11 16:05:17 +07:00
committed by GitHub
2 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -1578,7 +1578,8 @@ fn reshape(s: &mut Session, p: &Value) -> Result<Value> {
Some(v) if v.is_array() => super::select::checked_refs(Some(v), "path.reshape")?.into_iter().collect(),
Some(_) => return Err(bad("path.reshape", "`focal` must be an array of [subpath, anchor] pairs")),
};
if radius.is_some() && !focal.is_empty() {
// An empty `focal` chooses the focal-point rule too.
if radius.is_some() && !matches!(p.get("focal"), None | Some(Value::Null)) {
return Err(bad("path.reshape", "`focal` and `radius` cannot be used together"));
}
// A step that names neither `focal` nor `radius` (as the Reshape tool recorded one before it