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>bb10
parent
c5e44920ba
commit
1ac6644dda
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue