Author: jmb
Date: Mon Nov 21 03:09:28 2011
New Revision: 13160
URL:
http://source.netsurf-browser.org?rev=13160&view=rev
Log:
Committing textarea_set_dimensions patch from Ole Loots.
Modified:
trunk/netsurf/desktop/textarea.c
trunk/netsurf/desktop/textarea.h
Modified: trunk/netsurf/desktop/textarea.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/desktop/textarea.c?rev=13...
==============================================================================
--- trunk/netsurf/desktop/textarea.c (original)
+++ trunk/netsurf/desktop/textarea.c Mon Nov 21 03:09:28 2011
@@ -1444,3 +1444,18 @@
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);
+}
Modified: trunk/netsurf/desktop/textarea.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/desktop/textarea.h?rev=13...
==============================================================================
--- trunk/netsurf/desktop/textarea.h (original)
+++ trunk/netsurf/desktop/textarea.h Mon Nov 21 03:09:28 2011
@@ -54,6 +54,6 @@
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