summaryrefslogtreecommitdiff
path: root/gtk/gtkoverlay.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-08-21 00:44:17 +0200
committerBenjamin Otte <otte@redhat.com>2015-08-21 00:47:30 +0200
commit2039ab8853c10e2b34a0bd7d0bd17b2ef5855db0 (patch)
tree87892990c15c1c57cba7eee709acb30bc9b1564b /gtk/gtkoverlay.c
parent2607aae7dd4bcbfd0cb6501af74602fc6005bd08 (diff)
downloadgtk+-2039ab8853c10e2b34a0bd7d0bd17b2ef5855db0.tar.gz
overlay: Use actual size of the overlay when positioning
Previously we were using the natural requested size which is unrelated.
Diffstat (limited to 'gtk/gtkoverlay.c')
-rw-r--r--gtk/gtkoverlay.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 48278e5004..75253a5932 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -369,10 +369,10 @@ gtk_overlay_get_child_position (GtkOverlay *overlay,
alloc->width = MAX (alloc->width, main_alloc.width);
break;
case GTK_ALIGN_CENTER:
- alloc->x += main_alloc.width / 2 - req.width / 2;
+ alloc->x += main_alloc.width / 2 - alloc->width / 2;
break;
case GTK_ALIGN_END:
- alloc->x += main_alloc.width - req.width;
+ alloc->x += main_alloc.width - alloc->width;
break;
case GTK_ALIGN_BASELINE:
default:
@@ -392,10 +392,10 @@ gtk_overlay_get_child_position (GtkOverlay *overlay,
alloc->height = MAX (alloc->height, main_alloc.height);
break;
case GTK_ALIGN_CENTER:
- alloc->y += main_alloc.height / 2 - req.height / 2;
+ alloc->y += main_alloc.height / 2 - alloc->height / 2;
break;
case GTK_ALIGN_END:
- alloc->y += main_alloc.height - req.height;
+ alloc->y += main_alloc.height - alloc->height;
break;
case GTK_ALIGN_BASELINE:
default: