Text - Fix for text's cursor position. 46/103146/1
authorVictor Cebollada <v.cebollada@samsung.com>
Wed, 7 Dec 2016 10:42:36 +0000 (10:42 +0000)
committerVictor Cebollada <v.cebollada@samsung.com>
Wed, 7 Dec 2016 10:50:57 +0000 (10:50 +0000)
* The control's size stored in the view-model is not updated
  when the text is void.
  If the text's alignment is not BEGIN, the cursor position
  is calculated badly.

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

index 5a82cc9..714a154 100644 (file)
@@ -1508,6 +1508,9 @@ Controller::UpdateTextType Controller::Relayout( const Size& size )
     // Set the update info to relayout the whole text.
     mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
     mImpl->mTextUpdateInfo.mCharacterIndex = 0u;
+
+    // Store the size used to layout the text.
+    mImpl->mModel->mVisualModel->mControlSize = size;
   }
 
   // Whether there are modify events.
@@ -2664,9 +2667,6 @@ bool Controller::DoRelayout( const Size& size,
         mImpl->mModel->mVisualModel->SetLayoutSize( layoutSize );
       }
     } // view updated
-
-    // Store the size used to layout the text.
-    mImpl->mModel->mVisualModel->mControlSize = size;
   }
 
   if( NO_OPERATION != ( ALIGN & operations ) )