If the size of the text is larger than the size of the control, 60/242260/1
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 25 Aug 2020 08:59:40 +0000 (17:59 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Tue, 25 Aug 2020 08:59:40 +0000 (17:59 +0900)
setting it to VerticalAlignment::Center cuts the top and bottom of the text.

The VerticalAlignment::CENTER setting works when the size of the control is enough.

Change-Id: I3d35b4dfceb4297c89bddfc5c5364de4be5bc646

dali-toolkit/internal/text/rendering/text-typesetter.cpp

index 5b424be..0256a43 100755 (executable)
@@ -337,6 +337,7 @@ PixelData Typesetter::Render( const Vector2& size, Toolkit::DevelText::TextDirec
     case VerticalAlignment::CENTER:
     {
       penY = static_cast<int>( 0.5f * ( size.height - layoutSize.height ) );
     case VerticalAlignment::CENTER:
     {
       penY = static_cast<int>( 0.5f * ( size.height - layoutSize.height ) );
+      penY = penY < 0.f ? 0.f : penY;
       break;
     }
     case VerticalAlignment::BOTTOM:
       break;
     }
     case VerticalAlignment::BOTTOM: