Improved text selection (#4127)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -327,7 +327,8 @@ int TextLayoutElement::getMouseOverIndex(const QPoint &abs) const
|
||||
auto &&text = this->getText();
|
||||
auto width = metrics.horizontalAdvance(this->getText()[i]);
|
||||
|
||||
if (x + width > abs.x())
|
||||
// accept mouse to be at only 50%+ of character width to increase index
|
||||
if (x + (width * 0.5) > abs.x())
|
||||
{
|
||||
if (text.size() > i + 1 && QChar::isLowSurrogate(text[i].unicode()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user