Fixed bug of TableLayout margin calculation.
authorJeahoon Kim <jeahoon.kim@samsung.com>
Wed, 17 Apr 2013 04:33:13 +0000 (13:33 +0900)
committerJeahoon Kim <jeahoon.kim@samsung.com>
Wed, 17 Apr 2013 10:49:26 +0000 (19:49 +0900)
Change-Id: Iaeed4ff101d3c358c4b1554633a4fad6ba04df54
Signed-off-by: Jeahoon Kim <jeahoon.kim@samsung.com>
src/ui/layout/FUi_LayoutTableLayout.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index d955ff7..4a6ed64
@@ -1742,17 +1742,17 @@ TableLayout::CalculateAlign(LayoutItemProxy& itemProxy, LayoutRect cellRect, Lay
 
        if (verticalAlign == ITEM_VERTICAL_ALIGN_TOP)
        {
-               if (itemRect.h > cellRect.h - margin.top)
+               if (itemRect.h > cellRect.h - margin.top - margin.bottom)
                {
-                       itemRect.h = cellRect.h - margin.top;
+                       itemRect.h = cellRect.h - margin.top - margin.bottom;
                }
                itemRect.y = cellRect.y + margin.top;
        }
        else if (verticalAlign == ITEM_VERTICAL_ALIGN_BOTTOM)
        {
-               if (itemRect.h > cellRect.h - margin.bottom)
+               if (itemRect.h > cellRect.h - margin.top - margin.bottom)
                {
-                       itemRect.h = cellRect.h - margin.bottom;
+                       itemRect.h = cellRect.h - margin.top - margin.bottom;
                }
                itemRect.y = cellRect.h + cellRect.y - itemRect.h - margin.bottom;
        }
@@ -1774,17 +1774,17 @@ TableLayout::CalculateAlign(LayoutItemProxy& itemProxy, LayoutRect cellRect, Lay
        }
        if (horizonAlign == ITEM_HORIZONTAL_ALIGN_RIGHT)
        {
-               if (itemRect.w > cellRect.w - margin.right)
+               if (itemRect.w > cellRect.w - margin.right - margin.left)
                {
-                       itemRect.w = cellRect.w - margin.right;
+                       itemRect.w = cellRect.w - margin.right - margin.left;
                }
                itemRect.x = cellRect.w + cellRect.x - itemRect.w - margin.right;
        }
        else if (horizonAlign == ITEM_HORIZONTAL_ALIGN_LEFT)
        {
-               if (itemRect.w > cellRect.w - margin.left)
+               if (itemRect.w > cellRect.w - margin.left - margin.right)
                {
-                       itemRect.w = cellRect.w - margin.left;
+                       itemRect.w = cellRect.w - margin.left - margin.right;
                }
                itemRect.x = cellRect.x + margin.left;
        }