diff options
author | Simon Ser <contact@emersion.fr> | 2021-09-20 18:46:55 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-09-22 10:45:39 -0600 |
commit | 3d4afbe9455a049b01a981ca10868cc6411827cc (patch) | |
tree | 7fec7156a65cccc2a0b43f6c1cbe4a1990c06fc2 | |
parent | 27b529f8a0a594a9933dbbaa81bd1167f791e4f9 (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-- | types/scene/wlr_scene.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 4004b500..2d3dccde 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/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; } |