[gnome-shell/gnome-40] st/widget: Include the shadow in the paint volume



commit 9301fdc7d5ca9ea03000542b70eb74d317c2e265
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Thu Jun 24 19:06:33 2021 +0800

    st/widget: Include the shadow in the paint volume
    
    Having an inaccurate paint volume didn't matter until ae338af1e8, but
    after that having too small a paint volume resulted in apparent clipping.
    Not because `clip_to_allocation` is set, but because the offscreen
    framebuffer is sized to fit the paint volume only.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1897>
    (cherry picked from commit c08c142f95556321bd96f5808a32571cacf7f715)

 src/st/st-widget.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 05a2dd134b..644b8e25af 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -794,6 +794,16 @@ st_widget_get_paint_volume (ClutterActor *self,
   if (!clutter_actor_get_clip_to_allocation (self))
     {
       ClutterActor *child;
+      StShadow *shadow_spec = st_theme_node_get_text_shadow (theme_node);
+
+      if (shadow_spec)
+        {
+          ClutterActorBox shadow_box;
+
+          st_shadow_get_box (shadow_spec, &alloc_box, &shadow_box);
+          clutter_paint_volume_union_box (volume, &shadow_box);
+        }
+
       /* Based on ClutterGroup/ClutterBox; include the children's
        * paint volumes, since they may paint outside our allocation.
        */


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