feat: Add smooth slide-up animation to SelectionToolbox (#4832)

This commit is contained in:
Chenlei Hu
2025-08-08 00:34:10 -04:00
committed by GitHub
parent 5d71d6f9cf
commit 95ab88693c
5 changed files with 134 additions and 4 deletions

View File

@@ -4130,6 +4130,7 @@ export class LGraphCanvas
const selected = this.selectedItems
if (!selected.size) return
const initialSelectionSize = selected.size
let wasSelected: Positionable | undefined
for (const sel of selected) {
if (sel === keepSelected) {
@@ -4170,8 +4171,12 @@ export class LGraphCanvas
}
}
this.state.selectionChanged = true
this.onSelectionChange?.(this.selected_nodes)
// Only set selectionChanged if selection actually changed
const finalSelectionSize = selected.size
if (initialSelectionSize !== finalSelectionSize) {
this.state.selectionChanged = true
this.onSelectionChange?.(this.selected_nodes)
}
}
/** @deprecated See {@link LGraphCanvas.deselectAll} */