diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-11-21 09:09:28 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-11-21 09:09:28 +0000 |
commit | 3f395ec3bf1e439eaa95f22219fce2f6e37c292f (patch) | |
tree | 56c7b2561cd96104e39642752f9fa8cf6454cbb0 | |
parent | 820312eb35e6fa4f0930a343e8d418c4e2011755 (diff) | |
download | netsurf-3f395ec3bf1e439eaa95f22219fce2f6e37c292f.tar.gz netsurf-3f395ec3bf1e439eaa95f22219fce2f6e37c292f.tar.bz2 |
Committing textarea_set_dimensions patch from Ole Loots.
svn path=/trunk/netsurf/; revision=13160
-rw-r--r-- | desktop/textarea.c | 15 | ||||
-rw-r--r-- | desktop/textarea.h | 2 |
2 files changed, 16 insertions, 1 deletions
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); +} diff --git a/desktop/textarea.h b/desktop/textarea.h index d8ec5c588..1cbe5fa43 100644 --- a/desktop/textarea.h +++ b/desktop/textarea.h @@ -54,6 +54,6 @@ bool textarea_mouse_action(struct text_area *ta, browser_mouse_state mouse, bool textarea_drag_end(struct text_area *ta, browser_mouse_state mouse, int x, int y); void textarea_get_dimensions(struct text_area *ta, int *width, int *height); - +void textarea_set_dimensions(struct text_area *ta, int width, int height); #endif |