[gtk/wip/otte/boxes: 40/52] widget: Move compuatation of what changed further up
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/boxes: 40/52] widget: Move compuatation of what changed further up
- Date: Fri, 15 Feb 2019 05:56:47 +0000 (UTC)
commit d65a60e0bdfd7ad3c3c2319b70921608678898a5
Author: Benjamin Otte <otte redhat com>
Date: Sat Feb 9 05:28:44 2019 +0100
widget: Move compuatation of what changed further up
This way, we can compare with literally the previous allocation and the
size will not be influenced by an adjusted allocation.
But more importantly, we can now use the transform/width/height values
for other stuff.
gtk/gtkwidget.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 39f50c3241..98505bbb59 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4141,6 +4141,12 @@ gtk_widget_size_allocate (GtkWidget *widget,
real_allocation = *allocation;
+ baseline_changed = priv->allocated_size_baseline != baseline;
+ size_changed = (priv->allocated_size.width != real_allocation.width ||
+ priv->allocated_size.height != real_allocation.height);
+ position_changed = (priv->allocated_size.x != real_allocation.x ||
+ priv->allocated_size.y != real_allocation.y);
+
priv->allocated_size = *allocation;
priv->allocated_size_baseline = baseline;
@@ -4229,12 +4235,6 @@ gtk_widget_size_allocate (GtkWidget *widget,
real_allocation.height = MAX (1, real_allocation.height);
}
- baseline_changed = priv->baseline != baseline;
- size_changed = (priv->width != real_allocation.width ||
- priv->height != real_allocation.height);
- position_changed = (priv->transform.x != real_allocation.x ||
- priv->transform.y != real_allocation.y);
-
/* Set the widget allocation to real_allocation now, pass the smaller allocation to the vfunc */
priv->transform.x = real_allocation.x;
priv->transform.y = real_allocation.y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]