diff options
| author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-11-09 09:38:00 +0100 |
|---|---|---|
| committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-11-15 07:57:48 +0100 |
| commit | d0cb311e0d3cd84c933bd993e6003f45be2ebdd8 (patch) | |
| tree | 965463aaef3922f88c3c44e8f77e5df9fc144136 /src/quick/items/qquicktextnodeengine.cpp | |
| parent | 6403d52d790b791a858663678c1e5de3dcf8f4df (diff) | |
Fix thin text decoration with fractional scaling
With fractional scales, 1 pixel thin underlines and other
text decoration get a lot of aliasing effects. Sometimes
it will disappear completely and other times it will
fill two pixels. The rendering depends on the fractional
position of the line, so any change that moves the text
may cause the line to render at a different width, causing
instability when resizing layouts for instance.
We were using rectangle nodes for this for convenience, but
even with antialiasing enabled, that does not look correct
for single-pixel lines. Instead, we use the new curve renderer
which can also draw nice antialiased straight lines.
Fixes: QTBUG-86977
Change-Id: I1367b1e2d25d167fac7d6284cb40a652ef4c3e9a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextnodeengine.cpp')
| -rw-r--r-- | src/quick/items/qquicktextnodeengine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index cc69c96720..be6e01df1f 100644 --- a/src/quick/items/qquicktextnodeengine.cpp +++ b/src/quick/items/qquicktextnodeengine.cpp @@ -801,7 +801,7 @@ void QQuickTextNodeEngine::addToSceneGraph(QSGInternalTextNode *parentNode, ? m_selectedTextColor : textDecoration.color; - parentNode->addRectangleNode(textDecoration.rect, color); + parentNode->addDecorationNode(textDecoration.rect, color); } // Finally add the selected text on top of everything |
