From 1ac6644ddacd93732faec22d1e47b7f0ac12753f Mon Sep 17 00:00:00 2001 From: Brad Stanton Date: Mon, 25 Jan 2016 13:00:22 -0500 Subject: [PATCH] Fixed rendering of translucent CSS borders to prevent visible overlap This fixes the rendering of translucent borders on CSS-styled widgets to prevent visible overlapping at the corners. This is done by using a miter joint (45 degree angle) if either of the adjacent edges are translucent. Previously, adjacent edges would be drawn at full length and overlap at the corners if both edges are BorderStyle_Solid and have identical QBrush objects. This works if both QBrush objects are opaque but causes visible overlap if one or both of them are translucent. Change-Id: I99d46c8634cb314e642c635439ed2f7819fcba6a Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/painting/qcssutil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qcssutil.cpp b/src/gui/painting/qcssutil.cpp index 86604c1586..a826532b43 100644 --- a/src/gui/painting/qcssutil.cpp +++ b/src/gui/painting/qcssutil.cpp @@ -337,8 +337,10 @@ static bool paintsOver(const QCss::BorderStyle *styles, const QBrush *colors, QC if (s2 == BorderStyle_None || colors[e2] == Qt::transparent) return true; - if ((s1 == BorderStyle_Solid && s2 == BorderStyle_Solid) && (colors[e1] == colors[e2])) + if ((s1 == BorderStyle_Solid && s2 == BorderStyle_Solid) && (colors[e1] == colors[e2]) + && colors[e1].isOpaque()) { return true; + } return false; }