Do not round up character coordinates for hotspots
ClosedPublic

Authored by mglb on Apr 26 2018, 9:57 PM.

Details

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

Diff Detail

Repository
R319 Konsole
Branch
arc/cursor-fixes/0004-Do-not-round-up-character-coordinates-for-hotspots
Lint
No Linters Available
Unit
No Unit Test Coverage
mglb requested review of this revision.Apr 26 2018, 9:57 PM
mglb created this revision.
mglb edited the summary of this revision. (Show Details)Apr 26 2018, 10:26 PM

Thanks confirmed issue - patch doesn't apply cleanly now - do you have time to rebase?

mglb updated this revision to Diff 33558.May 3 2018, 3:35 PM

Rebase

hindenburg accepted this revision.May 4 2018, 3:12 AM
This revision is now accepted and ready to land.May 4 2018, 3:12 AM
This revision was automatically updated to reflect the committed changes.