3e238113f8
When calculating the width of a text for drawing decorations on top, we use the effective advance of the whole text after it has been through the shaper. However, in the case of QStaticText and QGlyphRun, there is shortcut: Since we only have the glyph indexes and position of each glyph, we use the position + advance of the right-most glyph to find the right-most edge of the decoration. For this, however, we use the advance of the glyph *out of context* of the rest of the string, because the whole idea is to avoid doing the shaping of the string with every draw call. In some rare cases, the advance of the right-most character, in the context of the string, is different from the advance of the standalone glyph. Now, one way of fixing this would be to store the width of the text in QStaticText and QGlyphRun, but since it is a very rare artifact which is barely visible, I have opted to just work around it in the test instead, the workaround being to force integer metrics so that we don't get the small 0.2 pixel error. Task-number: QTBUG-55217 Change-Id: I8d16d52f2ef27275cabb7d3865aeeaa31617ba3d Reviewed-by: Lars Knoll <lars.knoll@qt.io> |
||
---|---|---|
.. | ||
qabstracttextdocumentlayout | ||
qcssparser | ||
qfont | ||
qfontcache | ||
qfontdatabase | ||
qfontmetrics | ||
qglyphrun | ||
qinputcontrol | ||
qrawfont | ||
qstatictext | ||
qsyntaxhighlighter | ||
qtextblock | ||
qtextcursor | ||
qtextdocument | ||
qtextdocumentfragment | ||
qtextdocumentlayout | ||
qtextformat | ||
qtextlayout | ||
qtextlist | ||
qtextobject | ||
qtextodfwriter | ||
qtextpiecetable | ||
qtextscriptengine | ||
qtexttable | ||
qzip | ||
text.pro |