summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <[email protected]>2021-09-20 18:46:55 +0200
committerSimon Zeni <[email protected]>2021-09-22 10:45:39 -0600
commit8bffb941c9a4791558e66bf0ce35af268c208203 (patch)
tree6b437980e68bbce926bc671e46ba45bf81594a0f
parentfe764946fa7c995adccf30ca40f294c8f1151d44 (diff)
scene: use scene_node_get_size in wlr_scene_node_at
This allows to unify the RECT and BUFFER code-paths. The BUFFER one will become more complicated with destination size and transforms.
-rw-r--r--wlr_scene.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/wlr_scene.c b/wlr_scene.c
index 4004b50..2d3dccd 100644
--- a/wlr_scene.c
+++ b/wlr_scene.c
@@ -528,14 +528,11 @@ struct wlr_scene_node *wlr_scene_node_at(struct wlr_scene_node *node,
struct wlr_scene_surface *scene_surface = wlr_scene_surface_from_node(node);
intersects = wlr_surface_point_accepts_input(scene_surface->surface, lx, ly);
break;
- case WLR_SCENE_NODE_RECT:;
- struct wlr_scene_rect *rect = scene_rect_from_node(node);
- intersects = lx >= 0 && lx < rect->width && ly >= 0 && ly < rect->height;
- break;
+ case WLR_SCENE_NODE_RECT:
case WLR_SCENE_NODE_BUFFER:;
- struct wlr_scene_buffer *scene_buffer = scene_buffer_from_node(node);
- intersects = lx >= 0 && lx < scene_buffer->buffer->width &&
- ly >= 0 && ly < scene_buffer->buffer->height;
+ int width, height;
+ scene_node_get_size(node, &width, &height);
+ intersects = lx >= 0 && lx < width && ly >= 0 && ly < height;
break;
}