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=90367315f9b3ae78597bbfa4968bea95186d0a6a;hpb=3638fc255ad784cecea605d0e942391b9051ccd4;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 9036731..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() @@ -144,6 +152,9 @@ void LinearLayout::MeasureHorizontal( MeasureSpec widthMeasureSpec, MeasureSpec MeasuredSize::State heightState; } childState = { MeasuredSize::State::MEASURED_SIZE_OK, MeasuredSize::State::MEASURED_SIZE_OK }; + // Reset total length + mTotalLength = 0; + // measure children, and determine if further resolution is required for( unsigned int i=0; iGetMeasuredHeight(); 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; } } } @@ -318,6 +329,9 @@ void LinearLayout::MeasureVertical( MeasureSpec widthMeasureSpec, MeasureSpec he MeasuredSize::State heightState; } childState = { MeasuredSize::State::MEASURED_SIZE_OK, MeasuredSize::State::MEASURED_SIZE_OK }; + // Reset total length + mTotalLength = 0; + // measure children, and determine if further resolution is required for( unsigned int i=0; iGetMargin(); 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; } } }