Fix misaligned selection region with text when centered
authorJonathan Liu <net147@gmail.com>
Tue, 22 Oct 2013 13:28:17 +0000 (00:28 +1100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 23 Oct 2013 11:34:52 +0000 (13:34 +0200)
commitc368cbad3a505d44894ff150dc25c74d0174ca15
treec40e214f5a4b4c49648a15262ecda43967e7d96f
parent8fced55b717b7659866e268ab4a09ccb8bec2841
Fix misaligned selection region with text when centered

If the text is centered, the x/y position in the selection QRectF may
be a multiple of 0.5 which is rounded up. This rounding causes
misalignment of the selection region with the text.

The alignment is fixed by using qFloor on the x and y components.

Task-number: QTBUG-34218
Task-number: QTBUG-34234
Change-Id: I4f2fadeb38602f62a93773c6e5faecf03b28069f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
(cherry picked from qtbase/5d8a882c11201a29475c5ea71cfb76c9de6573f5)
src/gui/text/qtextlayout.cpp