mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-03 08:06:26 +03:00
Fix caret placement in multi-line textareas.
This commit is contained in:
parent
3269333658
commit
4cad82db9f
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user