diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-02-05 10:03:46 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-02-07 08:54:11 +0100 |
commit | 78da102810067ea951990577ce7b6f722aafdeb9 (patch) | |
tree | 9c3c82620f0935ad3d6617ac2183a0a94f7d3a16 /header.LGPL | |
parent | 31911d387b4b06725241543d3298b9b2549b397c (diff) | |
download | qtbase-78da102810067ea951990577ce7b6f722aafdeb9.tar.gz |
Make text decorations consistent between ways of drawing text
The drawGlyphRun() and drawStaticText() functions would calculate
the horizontal origin of the decorations based on the left-most edge
of the left-most glyph, in practice including the left bearing of
that glyph in the position. But in drawText()/QTextLayout it will
always be drawn from the position given as input by the user of the
function.
The inconsistency was detected in an upgrade of Harfbuzz NG, where
the tests on macOS would get a -0.05 left bearing, and as a result
the decorations would be painted one pixel to the left in
drawGlyphRun()/drawStaticText() compared to QTextLayout.
It is not a big deal in practice, but in order to get the Harfbuzz
update in, we fix the inconsistency now, by passing the user-input
position into the decoration function.
This was also an opportunity to consolidate the two code paths, and
to unexport the qt_draw_decoration_for_glyphs() symbol, which was
exported in Qt 4 only to be usable by Qt Quick 1.
Change-Id: I243404b2710ae378e84d7587efae719da3879944
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'header.LGPL')
0 files changed, 0 insertions, 0 deletions