fix syntax

This commit is contained in:
2026-02-17 09:15:15 -06:00
parent f310c18b84
commit 4e1b63fd0e
52 changed files with 2169 additions and 1754 deletions

View File

@@ -35,12 +35,16 @@ function find_path(node, path, pos) {
if (!rect_contains(node, pos)) return null
var next_path = array(path, node)
var i = 0
var child = null
var child_path = null
if (node[clay.CHILDREN] && !should_skip_children(node)) {
// Children drawn later should be tested first; reverse if your render order differs
for (var i = length(node[clay.CHILDREN]) - 1; i >= 0; i--) {
var child = node[clay.CHILDREN][i]
var child_path = find_path(child, next_path, pos)
i = length(node[clay.CHILDREN]) - 1
for (; i >= 0; i--) {
child = node[clay.CHILDREN][i]
child_path = find_path(child, next_path, pos)
if (child_path) return child_path
}
}
@@ -65,7 +69,8 @@ clay_input.bubble = function bubble(deepest, prop) {
return null
}
clay_input.click = function click(tree_root, mousepos, button = 'left') {
clay_input.click = function click(tree_root, mousepos, button) {
var _button = button || 'left'
var deepest = clay_input.deepest(tree_root, mousepos)
var action_target = clay_input.bubble(deepest, 'action')
if (action_target && action_target.config.action) action_target.config.action()