diff options
author | Timm Bäder <mail@baedert.org> | 2017-06-28 08:19:35 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:15 -0400 |
commit | 3dc6d240b34cb8695e421981acfe1efd2239bb1e (patch) | |
tree | 06d829ddf5ccf12bd91eed189b13a850ce9e98e5 /gtk/gtkdrawingarea.c | |
parent | 2c2867d45d15ba72410993ba6c65ab728401762b (diff) | |
download | gtk+-3dc6d240b34cb8695e421981acfe1efd2239bb1e.tar.gz |
Fix a few allocation coordinates & sizes
Diffstat (limited to 'gtk/gtkdrawingarea.c')
-rw-r--r-- | gtk/gtkdrawingarea.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c index 7478256ff4..cc2c94ae6e 100644 --- a/gtk/gtkdrawingarea.c +++ b/gtk/gtkdrawingarea.c @@ -28,6 +28,7 @@ #include "gtkprivate.h" #include "gtksnapshot.h" #include "gtkstylecontext.h" +#include "gtkwidgetprivate.h" typedef struct _GtkDrawingAreaPrivate GtkDrawingAreaPrivate; @@ -235,21 +236,22 @@ gtk_drawing_area_snapshot (GtkWidget *widget, GtkDrawingArea *self = GTK_DRAWING_AREA (widget); GtkDrawingAreaPrivate *priv = gtk_drawing_area_get_instance_private (self); cairo_t *cr; + int width, height; if (!priv->draw_func) return; + gtk_widget_get_content_size (widget, &width, &height); + cr = gtk_snapshot_append_cairo (snapshot, &GRAPHENE_RECT_INIT ( 0, 0, - gtk_widget_get_allocated_width (widget), - gtk_widget_get_allocated_height (widget) + width, height ), "DrawingAreaContents"); priv->draw_func (self, cr, - gtk_widget_get_allocated_width (widget), - gtk_widget_get_allocated_height (widget), + width, height, priv->draw_func_target); cairo_destroy (cr); } |