mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
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.
This commit is contained in:
parent
27b529f8a0
commit
3d4afbe945
1 changed files with 4 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue