X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Flayouting%2Fflex-layout-impl.cpp;h=1df4f5faa6f76f9dc63df7b6b4d332e4fe9d7906;hb=94a17596be5c49de1bd7f19b997b6625a4407083;hp=bf5d084aa4580e464efe6182392b8dd60182aea4;hpb=4d704bbcb7e9c4249f6f61b80308ad438ed57b4a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/layouting/flex-layout-impl.cpp b/dali-toolkit/internal/layouting/flex-layout-impl.cpp index bf5d084..1df4f5f 100644 --- a/dali-toolkit/internal/layouting/flex-layout-impl.cpp +++ b/dali-toolkit/internal/layouting/flex-layout-impl.cpp @@ -218,23 +218,23 @@ void FlexLayout::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeas if( widthMeasureSpec.GetMode() == MeasureSpec::Mode::EXACTLY ) { - width = widthMeasureSpec.GetSize(); + width = widthMeasureSpec.GetSize().AsFloat(); YGNodeStyleSetWidth( mRoot, width ); } else if( widthMeasureSpec.GetMode() == MeasureSpec::Mode::AT_MOST ) { - width = widthMeasureSpec.GetSize(); + width = widthMeasureSpec.GetSize().AsFloat(); YGNodeStyleSetMaxWidth( mRoot, width ); } if ( heightMeasureSpec.GetMode() == MeasureSpec::Mode::EXACTLY ) { - height = heightMeasureSpec.GetSize(); + height = heightMeasureSpec.GetSize().AsFloat(); YGNodeStyleSetHeight( mRoot, height ); } else if ( heightMeasureSpec.GetMode() == MeasureSpec::Mode::AT_MOST ) { - height = heightMeasureSpec.GetSize(); + height = heightMeasureSpec.GetSize().AsFloat(); YGNodeStyleSetMaxHeight( mRoot, height ); } @@ -249,8 +249,8 @@ void FlexLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, La auto owner = GetOwner(); auto actor = Actor::DownCast(owner); bool isLayoutRtl = actor ? actor.GetProperty( Actor::Property::LAYOUT_DIRECTION ).Get() == LayoutDirection::RIGHT_TO_LEFT: false; - auto width = right - left; - auto height = bottom - top; + LayoutLength width = right - left; + LayoutLength height = bottom - top; #if defined(DEBUG_ENABLED) std::ostringstream oss; @@ -263,7 +263,7 @@ void FlexLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, La DALI_LOG_INFO( gLogFilter, Debug::Concise, oss.str().c_str() ); #endif - YGNodeCalculateLayout( mRoot, width, height, isLayoutRtl ? YGDirectionRTL : YGDirectionLTR ); + YGNodeCalculateLayout( mRoot, width.AsFloat(), height.AsFloat(), isLayoutRtl ? YGDirectionRTL : YGDirectionLTR ); auto count = GetChildCount(); for( unsigned int childIndex = 0; childIndex < count; childIndex++) @@ -272,10 +272,10 @@ void FlexLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, La if( childLayout != nullptr ) { YGNodeRef node = YGNodeGetChild(mRoot, childIndex); - auto childLeft = YGNodeLayoutGetLeft( node ) + left; - auto childTop = YGNodeLayoutGetTop( node ) + top; - auto childWidth = YGNodeLayoutGetWidth( node ); - auto childHeight = YGNodeLayoutGetHeight( node ); + LayoutLength childLeft = LayoutLength( YGNodeLayoutGetLeft( node ) ) + left; + LayoutLength childTop = LayoutLength( YGNodeLayoutGetTop( node ) ) + top; + LayoutLength childWidth = LayoutLength( YGNodeLayoutGetWidth( node ) ); + LayoutLength childHeight = LayoutLength( YGNodeLayoutGetHeight( node ) ); childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight ); } } @@ -332,12 +332,12 @@ YGSize FlexLayout::OnChildMeasure( YGNodeRef node, // Remove padding here since Yoga doesn't consider it as a part of the node size Extents padding = childLayout->GetPadding(); - auto measuredWidth = childLayout->GetMeasuredWidth() - padding.end - padding.start; - auto measuredHeight = childLayout->GetMeasuredHeight() - padding.bottom - padding.top; + LayoutLength measuredWidth = childLayout->GetMeasuredWidth() - padding.end - padding.start; + LayoutLength measuredHeight = childLayout->GetMeasuredHeight() - padding.bottom - padding.top; return YGSize{ - .width = measuredWidth, - .height = measuredHeight, + .width = measuredWidth.AsFloat(), + .height = measuredHeight.AsFloat(), }; }