diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-01-14 11:46:56 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-01-14 11:46:56 +0000 |
commit | 700aea8b08c565926e35d1816ad8a1db36f1462c (patch) | |
tree | 0203388e4c2c542fac1a0e758e8235c59ad8d14f /desktop/textarea.c | |
parent | 2b7bc02961a3fa251f58618b73527968cecda8ef (diff) | |
download | netsurf-700aea8b08c565926e35d1816ad8a1db36f1462c.tar.gz netsurf-700aea8b08c565926e35d1816ad8a1db36f1462c.tar.bz2 |
Fix caret removal redraw to take account of border width. Fix scroll_visible to take account of border width in vertical scroll.
Diffstat (limited to 'desktop/textarea.c')
-rw-r--r-- | desktop/textarea.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c index 94d9b96c1..3241cf9d3 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -237,7 +237,7 @@ static bool textarea_scroll_visible(struct textarea *ta) x0 = ta->border_width + ta->pad_left; x1 = ta->vis_width - (ta->border_width + ta->pad_left); y0 = 0; - y1 = ta->vis_height; + y1 = ta->vis_height - 2 * ta->border_width; x = ta->caret_x - ta->scroll_x; y = ta->caret_y - ta->scroll_y; @@ -754,13 +754,14 @@ bool textarea_set_caret(struct textarea *ta, int caret) text_y_offset = ta->border_width + ta->pad_top; } else { /* Single line text area; text is vertically centered */ - text_y_offset = (ta->vis_height - ta->line_height + 1) / 2; + text_y_offset = ta->border_width; + text_y_offset += (ta->vis_height - ta->line_height + 1) / 2; } /* Delete the old caret */ if (ta->caret_pos.char_off != -1) { x0 = ta->caret_x - ta->scroll_x; - y0 = ta->caret_y - ta->scroll_y; + y0 = ta->caret_y + text_y_offset - ta->scroll_y; width = 2; height = ta->line_height; |