From 3f395ec3bf1e439eaa95f22219fce2f6e37c292f Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 21 Nov 2011 09:09:28 +0000 Subject: Committing textarea_set_dimensions patch from Ole Loots. svn path=/trunk/netsurf/; revision=13160 --- desktop/textarea.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'desktop/textarea.c') diff --git a/desktop/textarea.c b/desktop/textarea.c index ccde1d976..1e94c7f1b 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -1444,3 +1444,18 @@ void textarea_get_dimensions(struct text_area *ta, int *width, int *height) if (height != NULL) *height = ta->vis_height; } + +/** + * Set the dimensions of a textarea, causing a reflow and + * emitting a redraw request. + * + * \param width the new width of the textarea + * \param height the new height of the textarea + */ +void textarea_set_dimensions(struct text_area *ta, int width, int height) +{ + ta->vis_width = width; + ta->vis_height = height; + textarea_reflow(ta, 0); + ta->redraw_request(ta->data, 0, 0, ta->vis_width, ta->vis_height); +} -- cgit v1.2.3