diff options
author | Wang Chuan <ouchuanm@outlook.com> | 2019-08-23 22:28:56 +0800 |
---|---|---|
committer | ouchuan <ouchuanm@outlook.com> | 2019-08-29 07:25:45 +0800 |
commit | 35acc9fc3c41446bacbbfe754f7f494de7f62411 (patch) | |
tree | 48104fb6fb867f635db35e855ea60b5cbe3bcdc0 /tests/auto/quick/qquicktext/data | |
parent | 8577f12bf4dfd9adfe8c5b85a3712bf1cc5ba0c3 (diff) |
QQuickTextNodeEngine: don't create background when its alpha is 0
If the alpha value for the background color of a text element is 0,
we don't need to create a rectangle node to represent it, as the
rectangle will be invisible anyway.
[ChangeLog][QtQuick][QQuickTextNodeEngine] don't create a new
rectangle node as the background of text, when the alpha of it is
0
Fixes: QTBUG-76137
Change-Id: I40c624ee8f61740fd07e7d3751a78b6224882913
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktext/data')
-rw-r--r-- | tests/auto/quick/qquicktext/data/transparentBackground.qml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktext/data/transparentBackground.qml b/tests/auto/quick/qquicktext/data/transparentBackground.qml new file mode 100644 index 0000000000..a10a1779bb --- /dev/null +++ b/tests/auto/quick/qquicktext/data/transparentBackground.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 + +Rectangle { + width: 200 + height: 200 + color: "white" + Text { + objectName: "text" + textFormat: Text.RichText + anchors.fill: parent + color: "black" + text: "<h1 style=\"background-color:rgba(255,255,255,0.00)\">foo</h1>" + verticalAlignment: Text.AlignTop + horizontalAlignment: Text.AlignLeft + } +} |