[gtk+/wip/baedert/drawing: 185/371] image: Offset rendering to the content allocation
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 185/371] image: Offset rendering to the content allocation
- Date: Sun, 16 Jul 2017 15:37:22 +0000 (UTC)
commit fb6bcaa22ab75ac853d1e9a596c75e5c67ba620e
Author: Timm Bäder <mail baedert org>
Date: Sun May 21 21:41:03 2017 +0200
image: Offset rendering to the content allocation
gtk/gtkimage.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index cb31c6c..7479718 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]