summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <florian.muellner@gmail.com>2013-07-06 01:27:38 +0200
committerEmmanuele Bassi <ebassi@gnome.org>2013-11-20 23:17:55 +0000
commitb2480914d183cc2b8f3aa80c9802c8de7d75014c (patch)
tree533ff12c682bdf777b94b4de2db7f718b6726b54
parentdef93f697c83704179cc2aaadb3955d566f24be5 (diff)
downloadclutter-b2480914d183cc2b8f3aa80c9802c8de7d75014c.tar.gz
box-layout: Fix child offsets
Currently, BoxLayout interprets the box passed into allocate() in a fairly peculiar way: - in the direction of the box, all space between [xy]1 and [xy]2 is distributed among children (e.g. children occupy the entire width/height of the box, offset by [xy]1) - in the opposite direction, expanded children receive space between [xy]1 and the height/width of the box (e.g. children occupy the width/height of the box minus [xy]1, offset by [xy]1) The second behavior doesn't make much sense, so adjust it to interpret the box parameter in the same way as the first one. https://bugzilla.gnome.org/show_bug.cgi?id=703809 (cherry picked from commit 5dd2dcf14ff4676ac4d84ef567d1bca1faaaab7a) Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
-rw-r--r--clutter/clutter-box-layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/clutter/clutter-box-layout.c b/clutter/clutter-box-layout.c
index f45180a4a..564a0fd53 100644
--- a/clutter/clutter-box-layout.c
+++ b/clutter/clutter-box-layout.c
@@ -1102,7 +1102,7 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
if (priv->orientation == CLUTTER_ORIENTATION_VERTICAL)
{
child_allocation.x1 = box->x1;
- child_allocation.x2 = MAX (1.0, box->x2 - box->x1);
+ child_allocation.x2 = MAX (1.0, box->x2);
if (priv->is_pack_start)
y = box->y2 - box->y1;
else
@@ -1111,7 +1111,7 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
else
{
child_allocation.y1 = box->y1;
- child_allocation.y2 = MAX (1.0, box->y2 - box->y1);
+ child_allocation.y2 = MAX (1.0, box->y2);
if (priv->is_pack_start)
x = box->x2 - box->x1;
else