summaryrefslogtreecommitdiff
path: root/desktop/textarea.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-11-21 09:09:28 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-11-21 09:09:28 +0000
commit3f395ec3bf1e439eaa95f22219fce2f6e37c292f (patch)
tree56c7b2561cd96104e39642752f9fa8cf6454cbb0 /desktop/textarea.c
parent820312eb35e6fa4f0930a343e8d418c4e2011755 (diff)
downloadnetsurf-3f395ec3bf1e439eaa95f22219fce2f6e37c292f.tar.gz
netsurf-3f395ec3bf1e439eaa95f22219fce2f6e37c292f.tar.bz2
Committing textarea_set_dimensions patch from Ole Loots.
svn path=/trunk/netsurf/; revision=13160
Diffstat (limited to 'desktop/textarea.c')
-rw-r--r--desktop/textarea.c15
1 files changed, 15 insertions, 0 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);
+}