Skip to content

Commit d67d3c4

Browse files
committed
fix: Pass click events down to children even when out of bounds to support clicking with offset modifiers
1 parent 1598d0d commit d67d3c4

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/kotlin/com/mineinabyss/guiy/layout/GuiyModifierNode.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,11 @@ internal class GuiyModifierNode(
9898
}
9999

100100
fun processClickEvent(event: ClickEvent): Boolean {
101-
if (!isInBounds(event)) return false
102101
// start from last child since user is shown last inventory added to tree
103102
if (next == null) return root.children.asReversed().any { it.layoutDelegate.processClickEvent(event) }
104103
val node = node
105104
next!!.processClickEvent(event)
106-
if(node is InteractionModifierNode && !event.isConsumed) {
105+
if(node is InteractionModifierNode && !event.isConsumed && isInBounds(event)) {
107106
event.position = event.globalPosition - IntOffset(x, y)
108107
node.onEvent(event)
109108
}

0 commit comments

Comments
 (0)