D12555: Do not round up character coordinates for hotspots

Mariusz Glebocki noreply at phabricator.kde.org
Thu Apr 26 21:57:11 UTC 2018


mglb created this revision.
mglb added a reviewer: Konsole.
mglb added a project: Konsole.
mglb requested review of this revision.

REVISION 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

BRANCH
  wip/cursor-fixes/0004-Do-not-round-up-character-coordinates-for-hotspots (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D12555

AFFECTED FILES
  src/TerminalDisplay.cpp
  src/TerminalDisplay.h

To: mglb, #konsole
Cc: #konsole, herrold, ngraham, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20180426/6aba8fb0/attachment.html>


More information about the konsole-devel mailing list