[gnome-shell/wip/fmuellner/border-transparency-fix] st: Special case "transparent" backgrounds



commit 1c9873aa592f33f69f93b7a49e400baa460b9f42
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Nov 22 20:41:44 2018 +0100

    st: Special case "transparent" backgrounds
    
    Usually borders are drawn on top the background, which means that if
    the latter is translucent, the effective border color will be different.
    However when the background color has a value of "transparent", the
    expectation is that there's effectively no background, which means the
    border color should be left unmodified.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/305

 src/st/st-theme-node-drawing.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index f59065aef..c68e6c062 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -244,6 +244,13 @@ over (const ClutterColor *source,
   ClutterColor src = *source;
   ClutterColor dst = *destination;
 
+  /* If the destination has value of "transparent", leave source unmodified */
+  if (dst.red == 0 && dst.green == 0 && dst.blue == 0 && dst.alpha == 0)
+    {
+      *result = *source;
+      return;
+    }
+
   premultiply (&src);
   premultiply (&dst);
 


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