Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.0
-
None
-
MS Windows
-
1de8a5bc428a53158028f5a71319d88538c19c54
Description
Try the following code in Qt 4.5 and Qt 4.6 on Windows XP:
QPainter p(this); QRect rect(3, 2, 940, 16); p.setPen(Qt::red); p.drawRect(rect); p.setPen(Qt::black); p.drawText(rect, Qt::AlignCenter, "qÁ");
The font has an odd-numbered height, while the rectangle has an even-numbered height, so the y-position of the text has to be rounded. In Qt 4.5 a bug caused the font height to be reported a pixel higher than what was actually true, thus giving us the effect of rounding the y-position up. When this bug was fixed in Qt 4.6, the text would move one pixel down as we now use the correct font height and round .5 numbers up.
We can go back to the old look and feel by rounding .5 numbers down in the text drawing code rather than up. This makes sense for text that has a heavy descent and light weight ascent, like most latin text, it's consistent with how old versions of Qt did it, and it's consistent with native look and feel.
Attachments
Issue Links
- resulted in
-
QTBUG-6770 Mac: regression due to commit 1de8a5bc428a53158028f5a71319d88538c19c54
- Closed