From ebbcc31fbd1cb6c733225edb876d148101fc7aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 9 Jun 2023 19:52:15 +0200 Subject: [PATCH] st/texture-cache: Set up sliced images to fill parent When using fractional scaling, the size of the loaded image with applied scaling may still differ from the displayed size. This is currently addressed by syncing the size of all slice actors in the (probably only) caller. Instead, set the actors to fill their parent automatically. Part-of: --- src/st/st-texture-cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index bbe31bda7..7037c07d1 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -1321,6 +1321,12 @@ on_sliced_image_loaded (GObject *source_object, if (g_task_had_error (task) || g_cancellable_is_cancelled (data->cancellable)) return; + clutter_actor_set_layout_manager (data->actor, + g_object_new (CLUTTER_TYPE_BIN_LAYOUT, NULL)); + /* stop propagation of child expand flags */ + clutter_actor_set_x_expand (data->actor, FALSE); + clutter_actor_set_y_expand (data->actor, FALSE); + pixbufs = g_task_propagate_pointer (task, NULL); for (list = pixbufs; list; list = list->next) @@ -1328,6 +1334,10 @@ on_sliced_image_loaded (GObject *source_object, ClutterActor *actor = load_from_pixbuf (GDK_PIXBUF (list->data), data->paint_scale, data->resource_scale); + clutter_actor_set_x_expand (actor, TRUE); + clutter_actor_set_y_expand (actor, TRUE); + clutter_actor_set_x_align (actor, CLUTTER_ACTOR_ALIGN_FILL); + clutter_actor_set_y_align (actor, CLUTTER_ACTOR_ALIGN_FILL); clutter_actor_hide (actor); clutter_actor_add_child (data->actor, actor); }