[gnome-shell/gnome-3-36] st/private: Multiply position in fb coordinates with resource scale



commit cb9bb62a21b5c5d6ac03e5d6abd82853bdcac30b
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Sun Jul 26 13:26:20 2020 +0200

    st/private: Multiply position in fb coordinates with resource scale
    
    The framebuffer we use for rendering shadows is scaled by the resource
    scale, that means we also need to offset coordinates when translating
    them to the framebuffers coordinate system.
    
    So far we forgot to do that when translating the framebuffer using the
    position of the actor, which lead to small rendering bugs of
    text-shadows for actors allocated at non-zero origins. To fix that,
    simply multiply those positions with the actors resource scale.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1390

 src/st/st-private.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/st/st-private.c b/src/st/st-private.c
index 70d31ef76c..6f1a7e1eda 100644
--- a/src/st/st-private.c
+++ b/src/st/st-private.c
@@ -509,6 +509,8 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
 
       cogl_color_init_from_4ub (&clear_color, 0, 0, 0, 0);
       clutter_actor_get_position (actor, &x, &y);
+      x *= resource_scale;
+      y *= resource_scale;
 
       cogl_framebuffer_clear (fb, COGL_BUFFER_BIT_COLOR, &clear_color);
       cogl_framebuffer_translate (fb, -x, -y, 0);


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