evas: Fix stacked box align
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 12 Dec 2016 09:17:30 +0000 (18:17 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 13 Dec 2016 07:12:27 +0000 (16:12 +0900)
I added a way to respect the object's alignment when adding them
to a stacked box, but that alignment should only be used when the
box align is set to fill, otherwise both aligns would conflict.

See 3df7b717c932adac481aa0ec527d4d5893b07bb8

src/bin/elementary/test_gfx_filters.c [new file with mode: 0644]
src/lib/evas/canvas/evas_object_box.c

diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
index f9952cd..81251c1 100644 (file)
@@ -1633,9 +1633,9 @@ _evas_box_layout_stack(Eo *o, Evas_Object_Box_Data *priv, Evas_Object_Box_Data *
         if ((new_w != child_w) || (new_h != child_h))
           evas_object_resize(child, new_w, new_h);
 
-        if (priv->align.h >= 0.0)
+        if ((align_x < 0) && (priv->align.h >= 0.0))
           off_x += (ow - new_w) * priv->align.h;
-        if (priv->align.v >= 0.0)
+        if ((align_y < 0) && (priv->align.v >= 0.0))
           off_y += (oh - new_h) * priv->align.v;
         evas_object_move(child, ox + off_x, oy + off_y);