From 12cb9288a539df89d4b4e7bdb21cd78da2cd10e3 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Thu, 4 Aug 2016 02:08:57 -0400 Subject: [PATCH] documentor; extras/html: Made it easier to position caret at beginning or end of text --- documentor/src/Documentor.ec | 2 +- extras/html/lines.ec | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/documentor/src/Documentor.ec b/documentor/src/Documentor.ec index 80a995b..7dfc77e 100644 --- a/documentor/src/Documentor.ec +++ b/documentor/src/Documentor.ec @@ -4229,7 +4229,7 @@ class HelpView : HTMLView if(setCaretX) caretX = sx; caretY = sy; - SetCaret(sx, sy, th); + SetCaret(sx-1, sy, th); { Point scrollPos = scroll; bool doScroll = false; diff --git a/extras/html/lines.ec b/extras/html/lines.ec index 7381e26..3623820 100644 --- a/extras/html/lines.ec +++ b/extras/html/lines.ec @@ -546,7 +546,8 @@ bool PickLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Blo surface.TextExtent(block.text + textPos, len, &tw, &th); // eSurface_WriteText(surface, x, y + h - th, block.text + textPos, len); - if(pickX >= x && pickY >= y+h-th && pickX < x + tw && pickY < y+h) + if(block.text[0] == ' ' && block.text[1] == 0) pickX += tw; else + if(pickX >= x && pickY >= y+h-th && pickX < x + tw + 2 && pickY < y+h) { result = true; *pickBlock = block; -- 1.8.3.1