QAccessibleTextEdit: Using x coordinate for calculate character width
authorJosé Millán Soto <fid@gpul.org>
Sun, 20 Mar 2011 18:19:32 +0000 (19:19 +0100)
committerOlivier Goffart <olivier.goffart@nokia.com>
Tue, 10 May 2011 10:54:43 +0000 (12:54 +0200)
Merge-request: 1148
Task-number: QTBUG-18233
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
(cherry picked from commit 6cd51aeec11e7a70ba560c350274d5a4bd43c9b9)

src/plugins/accessible/widgets/qaccessiblewidgets.cpp

index 09b5015..ca3f827 100644 (file)
@@ -1334,7 +1334,7 @@ QRect QAccessibleTextEdit::characterRect(int offset, CoordinateType coordType)
 
     QRect r = edit->cursorRect(cursor);
     if (cursor.movePosition(QTextCursor::NextCharacter)) {
-        r.setWidth(edit->cursorRect(cursor).y() - r.y());
+        r.setWidth(edit->cursorRect(cursor).x() - r.x());
     } else {
         // we don't know the width of the character - maybe because we're at document end
         // in that case, IAccessible2 tells us to return the width of a default character