Fix for a single line text's vertical alignment. 26/93326/2
authorVictor Cebollada <v.cebollada@samsung.com>
Fri, 21 Oct 2016 14:57:11 +0000 (15:57 +0100)
committerVíctor Cebollada <v.cebollada@samsung.com>
Fri, 21 Oct 2016 15:47:16 +0000 (08:47 -0700)
* Use case:
  - A TextField with the vertical alignment set to CENTER.
  - Add some text. It's correctly aligned.
  - Remove some text with the back space. It aligns the text to the TOP

Change-Id: I5c8c6f2bd81d8f78ba5ec2835c1e55531cb99a77
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
dali-toolkit/internal/text/text-controller-impl.cpp

index 7b3f2d6..dcb2901 100644 (file)
@@ -2683,6 +2683,12 @@ void Controller::Impl::ClampHorizontalScroll( const Vector2& layoutSize )
 
 void Controller::Impl::ClampVerticalScroll( const Vector2& layoutSize )
 {
 
 void Controller::Impl::ClampVerticalScroll( const Vector2& layoutSize )
 {
+  if( LayoutEngine::SINGLE_LINE_BOX == mLayoutEngine.GetLayout() )
+  {
+    // Nothing to do if the text is single line.
+    return;
+  }
+
   // Clamp between -space & 0.
   if( layoutSize.height > mVisualModel->mControlSize.height )
   {
   // Clamp between -space & 0.
   if( layoutSize.height > mVisualModel->mControlSize.height )
   {