From d05f14f38bd5dcd456f1d81b5695feee8ac6bd5a Mon Sep 17 00:00:00 2001 From: Loukas Agorgianitis Date: Mon, 14 Apr 2025 11:33:10 +0200 Subject: [PATCH] scene: use fractional sizes for rects Signed-off-by: Loukas Agorgianitis --- include/wlr/types/wlr_scene.h | 6 +++--- types/scene/wlr_scene.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 629744496..a7fecb38f 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -141,7 +141,7 @@ struct wlr_scene_surface { /** A scene-graph node displaying a solid-colored rectangle */ struct wlr_scene_rect { struct wlr_scene_node node; - int width, height; + double width, height; float color[4]; }; @@ -453,12 +453,12 @@ void wlr_scene_surface_send_frame_done(struct wlr_scene_surface *scene_surface, * The color argument must be a premultiplied color value. */ struct wlr_scene_rect *wlr_scene_rect_create(struct wlr_scene_tree *parent, - int width, int height, const float color[static 4]); + double width, double height, const float color[static 4]); /** * Change the width and height of an existing rectangle node. */ -void wlr_scene_rect_set_size(struct wlr_scene_rect *rect, int width, int height); +void wlr_scene_rect_set_size(struct wlr_scene_rect *rect, double width, double height); /** * Change the color of an existing rectangle node. diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 7b5ff28e1..b9da6252b 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -724,7 +724,7 @@ static void scene_node_update(struct wlr_scene_node *node, } struct wlr_scene_rect *wlr_scene_rect_create(struct wlr_scene_tree *parent, - int width, int height, const float color[static 4]) { + double width, double height, const float color[static 4]) { assert(parent); assert(width >= 0 && height >= 0); @@ -743,7 +743,7 @@ struct wlr_scene_rect *wlr_scene_rect_create(struct wlr_scene_tree *parent, return scene_rect; } -void wlr_scene_rect_set_size(struct wlr_scene_rect *rect, int width, int height) { +void wlr_scene_rect_set_size(struct wlr_scene_rect *rect, double width, double height) { if (rect->width == width && rect->height == height) { return; }