From: barbieri Date: Sat, 28 Feb 2009 17:10:03 +0000 (+0000) Subject: Fix flow layout if box size is smaller than required. X-Git-Tag: 2.0_alpha~240^2~2578 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df3d529bdb74d9b27c9911435b9783a0bface216;p=framework%2Fuifw%2Fevas.git Fix flow layout if box size is smaller than required. Reported and fix suggestion by Viktor Kojouharov. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@39286 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_box.c b/src/lib/canvas/evas_object_box.c index 084c485..5e84c43 100644 --- a/src/lib/canvas/evas_object_box.c +++ b/src/lib/canvas/evas_object_box.c @@ -1507,12 +1507,15 @@ evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *pri v_justify = 0; remain_y = h - (off_y + max_h); - if (priv->align.v >= 0.0) - inc_y = priv->align.v * remain_y; - else if (row_count == 0) - y += remain_y / 2; - else /* y-justified */ - inc_y = remain_y / row_count; + if (remain_y > 0) + { + if (priv->align.v >= 0.0) + inc_y = priv->align.v * remain_y; + else if (row_count == 0) + y += remain_y / 2; + else /* y-justified */ + inc_y = remain_y / row_count; + } for (i = 0, r = 0, l = priv->children; r <= row_count; r++) { @@ -1681,12 +1684,15 @@ evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, h_justify = 0; remain_x = w - (off_x + max_w); - if (priv->align.h >= 0) - inc_x = priv->align.h * remain_x; - else if (col_count == 0) - x += remain_x / 2; - else /* x-justified */ - inc_x = remain_x / col_count; + if (remain_x > 0) + { + if (priv->align.h >= 0) + inc_x = priv->align.h * remain_x; + else if (col_count == 0) + x += remain_x / 2; + else /* x-justified */ + inc_x = remain_x / col_count; + } for (i = 0, c = 0, l = priv->children; c <= col_count; c++) {