-
- if( desiredHeight == Toolkit::ChildLayoutData::WRAP_CONTENT )
- {
- measureHeightMode = MeasureSpec::Mode::UNSPECIFIED;
- }
-
- MeasureSpec widthMeasureSpec = MeasureSpec( desiredWidth, measureWidthMode );
- MeasureSpec heightMeasureSpec = MeasureSpec( desiredHeight, measureHeightMode );
- if( measureWidthMode == MeasureSpec::Mode::UNSPECIFIED ||
- measureHeightMode == MeasureSpec::Mode::UNSPECIFIED )
- {
- // A measure just to get the size if the wrapped content
- childLayout->Measure( widthMeasureSpec, heightMeasureSpec );
- desiredWidth = childLayout->GetMeasuredWidth();
- desiredHeight = childLayout->GetMeasuredHeight();
- // Remove padding here since the second measure will add it back
- Extents padding = childLayout->GetPadding();
- desiredWidth = desiredWidth - padding.end - padding.start;
- desiredHeight = desiredHeight - padding.bottom - padding.top;
- }
-
- // Safety check to avoid going out of boundary
- if( (innerWidth != YGUndefined && innerWidth != 0) && innerWidth < desiredWidth )