image: Offset rendering to the content allocation

This commit is contained in:
Timm Bäder
2017-05-21 21:41:03 +02:00
committed by Matthias Clasen
parent 90c8a3f920
commit 3e555e1646

View File

@@ -1392,14 +1392,16 @@ gtk_image_snapshot (GtkWidget *widget,
GtkImage *image = GTK_IMAGE (widget);
GtkImagePrivate *priv = gtk_image_get_instance_private (image);
GtkAllocation allocation;
GtkAllocation content_allocation;
int x, y, width, height;
gint w, h, baseline;
gtk_widget_get_allocation (widget, &allocation);
x = 0;
y = 0;
width = allocation.width;
height = allocation.height;
gtk_widget_get_content_allocation (widget, &content_allocation);
x = content_allocation.x - allocation.x;
y = content_allocation.y - allocation.y;
width = content_allocation.width;
height = content_allocation.height;
_gtk_icon_helper_get_size (priv->icon_helper, &w, &h);