mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
revert churn reducings from layoutStore.ts
This commit is contained in:
@@ -457,20 +457,6 @@ class LayoutStoreImpl implements LayoutStore {
|
||||
const existing = this.slotLayouts.get(key)
|
||||
|
||||
if (existing) {
|
||||
// Short-circuit if nothing changed to avoid spatial index churn
|
||||
if (
|
||||
existing.nodeId === layout.nodeId &&
|
||||
existing.index === layout.index &&
|
||||
existing.type === layout.type &&
|
||||
existing.position.x === layout.position.x &&
|
||||
existing.position.y === layout.position.y &&
|
||||
existing.bounds.x === layout.bounds.x &&
|
||||
existing.bounds.y === layout.bounds.y &&
|
||||
existing.bounds.width === layout.bounds.width &&
|
||||
existing.bounds.height === layout.bounds.height
|
||||
) {
|
||||
return
|
||||
}
|
||||
// Update spatial index
|
||||
this.slotSpatialIndex.update(key, layout.bounds)
|
||||
} else {
|
||||
@@ -1456,26 +1442,9 @@ class LayoutStoreImpl implements LayoutStore {
|
||||
const ynode = this.ynodes.get(nodeId)
|
||||
if (!ynode) continue
|
||||
|
||||
// Short-circuit when bounds are unchanged to avoid churn
|
||||
const currentBounds = this.getNodeField(ynode, 'bounds')
|
||||
const sameBounds =
|
||||
currentBounds.x === bounds.x &&
|
||||
currentBounds.y === bounds.y &&
|
||||
currentBounds.width === bounds.width &&
|
||||
currentBounds.height === bounds.height
|
||||
if (sameBounds) continue
|
||||
|
||||
this.spatialIndex.update(nodeId, bounds)
|
||||
ynode.set('bounds', bounds)
|
||||
|
||||
// Keep size in sync with bounds
|
||||
const currentSize = this.getNodeField(ynode, 'size')
|
||||
if (
|
||||
currentSize.width !== bounds.width ||
|
||||
currentSize.height !== bounds.height
|
||||
) {
|
||||
ynode.set('size', { width: bounds.width, height: bounds.height })
|
||||
}
|
||||
ynode.set('size', { width: bounds.width, height: bounds.height })
|
||||
}
|
||||
}, this.currentActor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user