mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 00:50:05 +00:00
[fix] Replace ES2023 toReversed() with ES2022-compatible implementation
Replaced array.toReversed() method calls with backwards iteration loops to maintain compatibility with ES2022 target in TypeScript configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1054,7 +1054,14 @@ export class LGraph implements LinkNetwork, BaseLGraph, Serialisable<Serialisabl
|
||||
* @returns The group or null
|
||||
*/
|
||||
getGroupOnPos(x: number, y: number): LGraphGroup | undefined {
|
||||
return this._groups.toReversed().find(g => g.isPointInside(x, y))
|
||||
// Iterate backwards through groups to find top-most
|
||||
for (let i = this._groups.length - 1; i >= 0; i--) {
|
||||
const group = this._groups[i]
|
||||
if (group.isPointInside(x, y)) {
|
||||
return group
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1064,7 +1071,14 @@ export class LGraph implements LinkNetwork, BaseLGraph, Serialisable<Serialisabl
|
||||
* @returns The group or null
|
||||
*/
|
||||
getGroupTitlebarOnPos(x: number, y: number): LGraphGroup | undefined {
|
||||
return this._groups.toReversed().find(g => g.isPointInTitlebar(x, y))
|
||||
// Iterate backwards through groups to find top-most
|
||||
for (let i = this._groups.length - 1; i >= 0; i--) {
|
||||
const group = this._groups[i]
|
||||
if (group.isPointInTitlebar(x, y)) {
|
||||
return group
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user