summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-01-10 12:46:33 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-01-10 12:46:33 +0000
commit4cad82db9f907fb8ffd42303527a976ca226cedd (patch)
treea73b8c1e38be55aae3fab7985d3edf402864cfe0 /desktop
parent32693336583eb14b488a01c6ea5f5e002ab3deb0 (diff)
downloadnetsurf-4cad82db9f907fb8ffd42303527a976ca226cedd.tar.gz
netsurf-4cad82db9f907fb8ffd42303527a976ca226cedd.tar.bz2
Fix caret placement in multi-line textareas.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/textarea.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 31effdc3c..0f42a9f30 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1058,12 +1058,12 @@ void textarea_redraw(struct textarea *ta, int x, int y,
/* There is no selection and caret is in horizontal
* clip range. */
int caret_height = ta->line_height - 1;
- y += ta->caret_y + text_y_offset;
- if (y + caret_height >= clip->y0 && y <= clip->y1)
+ r.y0 = y + ta->caret_y + text_y_offset;
+ if (r.y0 + caret_height >= clip->y0 && r.y0 <= clip->y1)
/* Caret in vertical clip range; plot */
- plot->line(x + ta->caret_x, y + ta->caret_y,
+ plot->line(x + ta->caret_x, r.y0,
x + ta->caret_x,
- y + ta->caret_y + caret_height,
+ r.y0 + caret_height,
&pstyle_stroke_caret);
}
}
@@ -1082,7 +1082,6 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
line = ta->caret_pos.line;
readonly = (ta->flags & TEXTAREA_READONLY ? true:false);
-
if (!(key <= 0x001F || (0x007F <= key && key <= 0x009F))) {
/* normal character insertion */
length = utf8_from_ucs4(key, utf8);