summaryrefslogtreecommitdiff
path: root/demos/gtk-demo/drawingarea.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2017-11-05 15:01:30 +0100
committerBenjamin Otte <otte@redhat.com>2017-11-05 15:01:30 +0100
commit3a3f73a4dc3e8600a6436142cc7010533e429b97 (patch)
treea74cb556f2a30472c27886150df80ad28b084013 /demos/gtk-demo/drawingarea.c
parentc4ecc0993afd18848c213b02d7bae77233b87d7c (diff)
downloadgtk+-3a3f73a4dc3e8600a6436142cc7010533e429b97.tar.gz
gtk-demo: Don't use get_allocation()
Use get_width()/get_height() instead.
Diffstat (limited to 'demos/gtk-demo/drawingarea.c')
-rw-r--r--demos/gtk-demo/drawingarea.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c
index a9bb8b4c58..6ae52530b1 100644
--- a/demos/gtk-demo/drawingarea.c
+++ b/demos/gtk-demo/drawingarea.c
@@ -23,16 +23,14 @@ static cairo_surface_t *surface = NULL;
static void
create_surface (GtkWidget *widget)
{
- GtkAllocation allocation;
cairo_t *cr;
if (surface)
cairo_surface_destroy (surface);
- gtk_widget_get_allocation (widget, &allocation);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- allocation.width,
- allocation.height);
+ gtk_widget_get_width (widget),
+ gtk_widget_get_height (widget));
/* Initialize the surface to white */
cr = cairo_create (surface);
@@ -71,8 +69,8 @@ draw_brush (GtkWidget *widget,
cairo_t *cr;
if (surface == NULL ||
- cairo_image_surface_get_width (surface) != gtk_widget_get_allocated_width (widget) ||
- cairo_image_surface_get_height (surface) != gtk_widget_get_allocated_height (widget))
+ cairo_image_surface_get_width (surface) != gtk_widget_get_width (widget) ||
+ cairo_image_surface_get_height (surface) != gtk_widget_get_height (widget))
create_surface (widget);
update_rect.x = x - 3;