[gnome-shell] st-texture-cache: Set sliced actor size in logical size



commit ef1697d00d83116572c0e71f955f3136041d6f9a
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Mon Feb 25 21:26:46 2019 +0100

    st-texture-cache: Set sliced actor size in logical size
    
    The actor size should be set in logical size more than in the actual size
    of the texture when using resource scale.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765011
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5

 src/st/st-texture-cache.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 402130770..b84f3ffdc 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1008,14 +1008,16 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
 }
 
 static ClutterActor *
-load_from_pixbuf (GdkPixbuf *pixbuf)
+load_from_pixbuf (GdkPixbuf *pixbuf,
+                  int        paint_scale,
+                  float      resource_scale)
 {
   g_autoptr(ClutterContent) image = NULL;
   ClutterActor *actor;
   int width = gdk_pixbuf_get_width (pixbuf);
   int height = gdk_pixbuf_get_height (pixbuf);
 
-  image = pixbuf_to_st_content_image (pixbuf, width, height, 1, 1.0f);
+  image = pixbuf_to_st_content_image (pixbuf, -1, -1, paint_scale, resource_scale);
 
   actor = clutter_actor_new ();
   clutter_actor_set_size (actor, width, height);
@@ -1109,7 +1111,9 @@ on_sliced_image_loaded (GObject *source_object,
 
   for (list = pixbufs; list; list = list->next)
     {
-      ClutterActor *actor = load_from_pixbuf (GDK_PIXBUF (list->data));
+      ClutterActor *actor = load_from_pixbuf (GDK_PIXBUF (list->data),
+                                              data->paint_scale,
+                                              data->resource_scale);
       clutter_actor_hide (actor);
       clutter_actor_add_child (data->actor, actor);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]