Improved text selection (#4127)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
kornes 2022-11-13 11:26:33 +00:00 committed by GitHub
parent 39f7d8ac4c
commit d409e3f17d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -79,6 +79,7 @@
- Minor: Make menus and placeholders display appropriate custom key combos. (#4045)
- Minor: Migrated /chatters to Helix API. (#4088, #4097, #4114)
- Minor: Migrated /mods to Helix API. (#4103)
- Minor: Improved text selection to match Windows native behaviour. (#4127)
- Minor: Add settings tooltips. (#3437)
- Minor: Improved look of tabs when using a layout other than top. (#3925)
- Bugfix: Fixed `Add new account` dialog causing main chatterino window to be non movable. (#4121)

View file

@ -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()))
{