fix node_by_point not properly considering window_rel
This commit is contained in:
parent
338e3f2d58
commit
802d611650
1 changed files with 2 additions and 4 deletions
|
@ -48,10 +48,8 @@ UINode *node_by_point(UINode *root, double x, double y)
|
|||
{
|
||||
for (int i = 0; i < root->nodes_count; i++) {
|
||||
UINode *node = root->nodes[i];
|
||||
double local_x = x - node->window_rel_x;
|
||||
double local_y = y - node->window_rel_y;
|
||||
if (ui_rect_contains_point(&node->rect, local_x, local_y) && !(node->flags & UI_NODE_DISABLED)) {
|
||||
return node_by_point(node, local_x, local_y);
|
||||
if (ui_rect_contains_point(&node->rect, x - node->window_rel_x, y - node->window_rel_y) && !(node->flags & UI_NODE_DISABLED)) {
|
||||
return node_by_point(node, x, y);
|
||||
}
|
||||
}
|
||||
return root;
|
||||
|
|
Loading…
Reference in a new issue