Fix group order unexpectedly reversing (#242)

This commit is contained in:
filtered
2024-10-31 10:48:48 +11:00
committed by GitHub
parent 116b21e8f5
commit b74662fbad
2 changed files with 3 additions and 3 deletions

View File

@@ -848,8 +848,8 @@ export class LGraph {
* @param y The y coordinate in canvas space
* @return The group or null
*/
getGroupOnPos(x: number, y: number, { margin = 2 } = {}) {
return this._groups.reverse().find(g => g.isPointInside(x, y, margin, /* skip_title */ true))
getGroupOnPos(x: number, y: number, { margin = 2 } = {}): LGraphGroup | undefined {
return this._groups.toReversed().find(g => g.isPointInside(x, y, margin, true))
}
/**