Merge "Use Actor target size for default layout." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / layouting / linear-layout-impl.cpp
index 003c4e6..7b3720c 100644 (file)
@@ -61,7 +61,11 @@ LinearLayout::~LinearLayout()
 
 void LinearLayout::SetCellPadding( LayoutSize size )
 {
-  mCellPadding = size;
+  if ( mCellPadding != size )
+  {
+    mCellPadding = size;
+    RequestLayout();
+  }
 }
 
 LayoutSize LinearLayout::GetCellPadding()
@@ -71,7 +75,11 @@ LayoutSize LinearLayout::GetCellPadding()
 
 void LinearLayout::SetOrientation( Dali::Toolkit::LinearLayout::Orientation orientation )
 {
-  mOrientation = orientation;
+  if ( mOrientation != orientation )
+  {
+    mOrientation = orientation;
+    RequestLayout();
+  }
 }
 
 Dali::Toolkit::LinearLayout::Orientation LinearLayout::GetOrientation()
@@ -279,12 +287,12 @@ void LinearLayout::LayoutHorizontal( LayoutLength left, LayoutLength top, Layout
   int start = 0;
   int dir = 1;
 
-  // In case of RTL, start drawing from the last child.
-  // @todo re-work to draw the first child from the right edge, and move leftwards.
-  // (Should have an alignment also)
+  // In case of RTL, start drawing from the last child and apply right alignment.
+  // @TODO Should we have also support Actor HorizontalAlignment|VerticalAlignment in general for LinearLayout?
   if( isLayoutRtl ) {
     start = count - 1;
     dir = -1;
+    childLeft = padding.start + right - left - mTotalLength;
   }
 
   for( unsigned int i = 0; i < count; i++)