Unify pin/unpin interface between LGraphNode and LGraphGroup (#274)

This commit is contained in:
Chenlei Hu
2024-11-04 15:09:17 -05:00
committed by GitHub
parent b663f86c9e
commit 5edfc185c5
3 changed files with 33 additions and 10 deletions

View File

@@ -12,9 +12,9 @@ export type NullableProperties<T> = {
export type CanvasColour = string | CanvasGradient | CanvasPattern
/**
/**
* An object that can be positioned, selected, and moved.
*
*
* May contain other {@link Positionable} objects.
*/
export interface Positionable {
@@ -46,6 +46,17 @@ export interface Positionable {
onDeselected?(): void
}
/**
* An object that can be pinned.
*
* Prevents the object being accidentally moved or resized by mouse interaction.
*/
export interface IPinnable {
pinned: boolean
pin(value?: boolean): void
unpin(): void
}
export interface IInputOrOutput {
// If an input, this will be defined
input?: INodeInputSlot