[3.0] Text - Fix for placement actor.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.cpp
index 24dd89c..58dbbc6 100644 (file)
@@ -1530,6 +1530,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->mVisualModel->mControlSize = size;
   }
 
   // Whether there are modify events.
@@ -2679,9 +2682,6 @@ bool Controller::DoRelayout( const Size& size,
         mImpl->mVisualModel->SetLayoutSize( layoutSize );
       }
     } // view updated
-
-    // Store the size used to layout the text.
-    mImpl->mVisualModel->mControlSize = size;
   }
 
   if( NO_OPERATION != ( ALIGN & operations ) )
@@ -2689,10 +2689,13 @@ bool Controller::DoRelayout( const Size& size,
     // The laid-out lines.
     Vector<LineRun>& lines = mImpl->mVisualModel->mLines;
 
+    // Need to align with the control's size as the text may contain lines
+    // starting either with left to right text or right to left.
     mImpl->mLayoutEngine.Align( size,
                                 startIndex,
                                 requestedNumberOfCharacters,
-                                lines );
+                                lines,
+                                mImpl->mAlignmentOffset );
 
     viewUpdated = true;
   }