Skip to content
Commit 20581971 authored by Mariusz Glebocki's avatar Mariusz Glebocki Committed by Kurt Hindenburg
Browse files

Do not round up character coordinates for hotspots

Summary:
When mouse pointer is mapped to character position, the algorithm
rounds the position to the nearest left edge of a character. This makes
sense for selections, but not for hotspots like links, where "character
under the pointer" is better solution. This patch adds edge mode as an
option to `getCharacterPosition` and disables it for hotspots.

Test Plan:
* Turn on "Underline links" option (Profile options → Mouse)
* Increase font size in Konsole so it will be easy to move mouse pointer
  above left or right half of the character
* Run: `echo -e 'www.kde.org\033[31;41m \033[0m'`
* Place pointer on the right half of the 'g' character

Expected result: underline should have the same color as the link
Actual result: underline uses color from the next character on the right

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12555
parent 4752c092
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment