summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorBrad Stanton <brad.stanton6@gmail.com>2016-01-25 13:00:22 -0500
committerBrad Stanton <brad.stanton6@gmail.com>2016-01-26 16:20:53 +0000
commit1ac6644ddacd93732faec22d1e47b7f0ac12753f (patch)
treebdfbf845d7f3a41e0a26f803ce27c74542942de2 /src/gui/painting
parentc5e44920ba1f6a75733b155d20f56d0ace4ac2ed (diff)
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) <ogoffart@woboq.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qcssutil.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}