+
+ // If label, test against it's size
+ Toolkit::TextLabel textLabel = Toolkit::TextLabel::DownCast( GetLabel() );
+ if( textLabel )
+ {
+ Vector3 textLabelSize = textLabel.GetNaturalSize();
+
+ if( widthIsZero )
+ {
+ size.width = std::max( size.width, textLabelSize.width + TEXT_PADDING * 2.0f );
+ }
+
+ if( heightIsZero )
+ {
+ size.height = std::max( size.height, textLabelSize.height + TEXT_PADDING * 2.0f );
+ }
+ }