[gtk+] image: Stop using gtk_widget_get_content_size
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] image: Stop using gtk_widget_get_content_size
- Date: Mon, 4 Dec 2017 11:39:33 +0000 (UTC)
commit 3a3783dfcde9f64155b44f2cfb1e5adbab1a0f80
Author: Timm Bäder <mail baedert org>
Date: Mon Dec 4 12:14:21 2017 +0100
image: Stop using gtk_widget_get_content_size
gtk/gtkimage.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 81710fa..6293197 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1199,11 +1199,12 @@ gtk_image_snapshot (GtkWidget *widget,
int x, y, width, height;
gint w, h, baseline;
- gtk_widget_get_content_size (widget, &width, &height);
- x = 0;
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
y = 0;
_gtk_icon_helper_get_size (&priv->icon_helper, &w, &h);
+ x = (width - w) / 2;
baseline = gtk_widget_get_allocated_baseline (widget);
@@ -1212,8 +1213,6 @@ gtk_image_snapshot (GtkWidget *widget,
else
y += CLAMP (baseline - h * gtk_image_get_baseline_align (image), 0, height - h);
- x += (width - w) / 2;
-
gtk_snapshot_offset (snapshot, x, y);
gtk_icon_helper_snapshot (&priv->icon_helper, snapshot);
gtk_snapshot_offset (snapshot, -x, -y);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]