X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Flayouting%2Flinear-layout-impl.cpp;h=64bee8c214006009d4f9667aa365fb26349e43ad;hb=20125e47f9f183b0d39972ada01280da8984d942;hp=6b91bc067e39f48b2a5c5af406fa0b8eeff7cba8;hpb=34d91b1758ac881dfde1ece06a7b152bd1353ae5;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/layouting/linear-layout-impl.cpp b/dali-toolkit/internal/layouting/linear-layout-impl.cpp old mode 100644 new mode 100755 index 6b91bc0..64bee8c --- a/dali-toolkit/internal/layouting/linear-layout-impl.cpp +++ b/dali-toolkit/internal/layouting/linear-layout-impl.cpp @@ -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() @@ -265,14 +273,14 @@ void LinearLayout::LayoutHorizontal( LayoutLength left, LayoutLength top, Layout Extents padding = GetPadding(); - LayoutLength childTop( 0 ); + LayoutLength childTop( padding.top ); LayoutLength childLeft( padding.start ); // Where bottom of child should go auto height = bottom - top; // Space available for child - auto childSpace = height - padding.top - padding.bottom; + auto childSpace = height - (int)padding.top - (int)padding.bottom; auto count = GetChildCount(); @@ -297,11 +305,11 @@ void LinearLayout::LayoutHorizontal( LayoutLength left, LayoutLength top, Layout auto childHeight = childLayout->GetMeasuredHeight(); auto childMargin = childLayout->GetMargin(); - childTop = LayoutLength(padding.top) + ((childSpace - childHeight) / 2) + childMargin.top - childMargin.bottom; + childTop = LayoutLength(padding.top) + (int)((childSpace - childHeight) / 2) + (int)childMargin.top - (int)childMargin.bottom; childLeft += childMargin.start; childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight ); - childLeft += childWidth + childMargin.end + mCellPadding.width; + childLeft += childWidth + (int)childMargin.end + mCellPadding.width; } } } @@ -425,14 +433,14 @@ void LinearLayout::LayoutVertical( LayoutLength left, LayoutLength top, LayoutLe { Extents padding = GetPadding(); - LayoutLength childTop( 0 ); + LayoutLength childTop( padding.top ); LayoutLength childLeft( padding.start ); // Where bottom of child should go auto width = right - left; // Space available for child - auto childSpace = width - padding.start - padding.end; + auto childSpace = width - (int)padding.start - (int)padding.end; auto count = GetChildCount(); for( unsigned int childIndex = 0; childIndex < count; childIndex++) @@ -445,10 +453,10 @@ void LinearLayout::LayoutVertical( LayoutLength left, LayoutLength top, LayoutLe auto childMargin = childLayout->GetMargin(); childTop += childMargin.top; - childLeft = ( childSpace - childWidth ) / 2 + childMargin.start - childMargin.end; + childLeft = LayoutLength( padding.start ) + ( childSpace - childWidth ) / 2 + childMargin.start - childMargin.end; childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight ); - childTop += childHeight + childMargin.bottom + mCellPadding.height; + childTop += childHeight + (int)childMargin.bottom + mCellPadding.height; } } }