fix(editor): guard null bounds in box-select registry-selectable branch (#359)
The registry-driven selectable branch in `collectNodeIdsInBounds` called `objectBoundsIntersectsBounds(node.id, bounds)` directly, but `bounds` is `Bounds | null` (null = select-all / no rectangle). Every other branch guards with `!bounds ||`; this one didn't, so `tsc --build` failed in consumers (`@pascal-app/nodes`) with TS2345 "Bounds | null not assignable to Bounds". Add the same guard, which also restores correct select-all behavior for registry-selectable kinds. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
eb1f2d12c2
commit
cfd644d40e
@@ -285,7 +285,7 @@ function collectNodeIdsInBounds(bounds: Bounds | null): string[] {
|
|||||||
// Registry-driven selectable kinds (shelf + future furnish/structure
|
// Registry-driven selectable kinds (shelf + future furnish/structure
|
||||||
// kinds) aren't in the hardcoded list above; pick them up by their
|
// kinds) aren't in the hardcoded list above; pick them up by their
|
||||||
// rendered bounding box, the same path column/stair use.
|
// rendered bounding box, the same path column/stair use.
|
||||||
if (objectBoundsIntersectsBounds(node.id, bounds)) {
|
if (!bounds || objectBoundsIntersectsBounds(node.id, bounds)) {
|
||||||
result.push(node.id)
|
result.push(node.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user