[gtk/wip/baedert/for-master: 20/23] renderborder: Avoid 0 width outline color nodes




commit 0b4ed8d7915bd3ddd23680c80643dbb5788d747a
Author: Timm Bäder <mail baedert org>
Date:   Mon Dec 21 09:28:26 2020 +0100

    renderborder: Avoid 0 width outline color nodes

 gtk/gtkrenderborder.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkrenderborder.c b/gtk/gtkrenderborder.c
index 9ee5a62a9f..3031f26a6b 100644
--- a/gtk/gtkrenderborder.c
+++ b/gtk/gtkrenderborder.c
@@ -743,8 +743,12 @@ gtk_css_style_snapshot_outline (GtkCssBoxes *boxes,
       if (gdk_rgba_is_clear (color))
         return;
 
-      border_style[1] = border_style[2] = border_style[3] = border_style[0];
       border_width[0] = _gtk_css_number_value_get (outline->outline_width, 100);
+
+      if (G_APPROX_VALUE (border_width[0], 0, FLT_EPSILON))
+        return;
+
+      border_style[1] = border_style[2] = border_style[3] = border_style[0];
       border_width[3] = border_width[2] = border_width[1] = border_width[0];
       colors[0] = colors[1] = colors[2] = colors[3] = *color;
 


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