summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@theqtcompany.com>2016-06-08 12:19:29 +0200
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2016-06-09 07:36:09 +0000
commit7c264643f6ed6da6a89ee369dbd9ef143f4222e7 (patch)
treed0715f1ec0fc30eafcc70679f8c76ba337cbcd80 /src/widgets/widgets
parent48fd845c6141d8ff353f65f87d669ef1c0f22bb2 (diff)
Fixed a bug where IM reported wrong anchor rectangle
The problem was that in some cases, the cursor position was used to calculate the anchor rectangle instead of the anchor position. This caused selection handles to be shown at the wrong position. Change-Id: I8d866b644fc3c4d530529b7f468d16ae1088cd98 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 86903dc0c3..23d52b278d 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -441,7 +441,7 @@ QRect QWidgetLineControl::anchorRect() const
{
if (!hasSelectedText())
return cursorRect();
- return rectForPos(m_selstart < m_selend ? m_selstart : m_selend);
+ return rectForPos(m_cursor == m_selstart ? m_selend : m_selstart);
}
/*!