mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 22:59:14 +00:00
convert to functional bounds collection
This commit is contained in:
@@ -38,20 +38,16 @@ export function useSelectionToolboxPosition(
|
||||
visible.value = true
|
||||
|
||||
// Get bounds from layout store for all selected items
|
||||
const allBounds: ReadOnlyRect[] = []
|
||||
for (const item of selectableItems) {
|
||||
if (typeof item.id === 'string') {
|
||||
const layout = layoutStore.getNodeLayoutRef(item.id).value
|
||||
if (layout) {
|
||||
allBounds.push([
|
||||
layout.bounds.x,
|
||||
layout.bounds.y,
|
||||
layout.bounds.width,
|
||||
layout.bounds.height
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
const allBounds: ReadOnlyRect[] = Array.from(selectableItems)
|
||||
.filter((item) => typeof item.id === 'string')
|
||||
.map((item) => layoutStore.getNodeLayoutRef(item.id as string).value)
|
||||
.filter((layout) => layout !== null)
|
||||
.map((layout) => [
|
||||
layout.bounds.x,
|
||||
layout.bounds.y,
|
||||
layout.bounds.width,
|
||||
layout.bounds.height
|
||||
])
|
||||
|
||||
// Compute union bounds
|
||||
const unionBounds = computeUnionBounds(allBounds)
|
||||
|
||||
Reference in New Issue
Block a user