From 68d314f3a9c49d07fd81b611d3bd7f1df1d00558 Mon Sep 17 00:00:00 2001 From: Jeffrey Lee Date: Sun, 10 Sep 2006 20:25:20 +0000 Subject: Fix wordwrap+horizontal scroll in textareas svn path=/trunk/netsurf/; revision=2947 --- desktop/textinput.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'desktop') diff --git a/desktop/textinput.c b/desktop/textinput.c index fe804c348..97f793b9f 100644 --- a/desktop/textinput.c +++ b/desktop/textinput.c @@ -656,6 +656,9 @@ void browser_window_textarea_callback(struct browser_window *bw, text_box = text_box->next; assert(text_box); assert(char_offset <= text_box->length); + /* Scroll back to the left */ + box_x += textarea->scroll_x; + textarea->scroll_x = 0; } else char_offset = text_box->length + text_box->space; @@ -1934,7 +1937,7 @@ bool ensure_caret_visible(struct box *textarea) scrolly = textarea->scroll_y; assert(textarea->gadget); /* Calculate the caret coordinates */ - cx = textarea->gadget->caret_pixel_offset; + cx = textarea->gadget->caret_pixel_offset+textarea->gadget->caret_text_box->x; cy = textarea->gadget->caret_text_box->y; /* Ensure they are visible */ if (!box_hscrollbar_present(textarea)) -- cgit v1.2.3