Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.4, 4.8.5, 5.1.1
-
None
-
Arch Linux x86/x86_64
Microsoft Windows XP Professional SP3
Microsoft Windows 7 Ultimate SP1 64-bit
-
c368cbad3a505d44894ff150dc25c74d0174ca15 5d8a882c11201a29475c5ea71cfb76c9de6573f5
Description
If text is aligned center horizontally, the selection highlight can overlap with the next character. It seems to be a rounding issue as increasing the layout width by 1 pixel fixes the overlap. Increase width by another pixel again and there is overlap. It cycles every 2 pixels. This doesn't occur when aligning left or right.
This can be seen in several places:
-QTextEdit - run the Rich Text example, higlight "Text" in "QTextEdit" title and resize the window width
-QTextLayout - see attached example
-QML Text item with a span having different background for the selected text (Qt Quick 1.1) - see https://bugreports.qt-project.org/browse/QTBUG-34218
-QML TextEdit - see https://bugreports.qt-project.org/browse/QTBUG-34220
Attachments
For Gerrit Dashboard: QTBUG-34234 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
68842,2 | Fix misaligned selection region with text when centered | stable | qt/qtbase | Status: MERGED | +2 | 0 |
68935,1 | Fix misaligned selection region with text when centered | 4.8 | qt/qt | Status: MERGED | +2 | 0 |