Improve hitbox for group resize (#277)

Now the same as the visual area

Co-authored-by: Chenlei Hu <huchenlei@proton.me>
This commit is contained in:
filtered
2024-11-07 11:35:56 +11:00
committed by GitHub
parent 7e21b00cc7
commit e1aac5cf61

View File

@@ -2076,8 +2076,7 @@ export class LGraphCanvas {
this.dragging_rectangle = null
}
const dist = distance([e.canvasX, e.canvasY], [group.pos[0] + group.size[0], group.pos[1] + group.size[1]])
if (dist * this.ds.scale < 10) {
if (group.isInResize(e.canvasX, e.canvasY)) {
this.resizingGroup = group
} else {
const f = group.font_size || LiteGraph.DEFAULT_GROUP_FONT_SIZE