Extents padding;
padding = self.GetProperty<Extents>(Toolkit::Control::Property::PADDING);
- Vector2 contentSize(size.x - (padding.start + padding.end), size.y - (padding.top + padding.bottom));
+ float width = std::max(size.x - (padding.start + padding.end), 0.0f);
+ float height = std::max(size.y - (padding.top + padding.bottom), 0.0f);
+ Vector2 contentSize(width, height);
+ // Support Right-To-Left
+ Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self);
+
+ // Support Right-To-Left of padding
+ if(Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection)
+ {
+ std::swap(padding.start, padding.end);
+ }
+
+ if(mController->GetRenderMode() == DevelTextLabel::Render::ASYNC_AUTO ||
+ mController->GetRenderMode() == DevelTextLabel::Render::ASYNC_MANUAL)
+ {
+ if(mController->GetRenderMode() == DevelTextLabel::Render::ASYNC_AUTO && mTextScroller && mTextScroller->IsScrolling() && !(mTextUpdateNeeded || sizeChanged))
+ {
+ // When auto scroll is playing, a text load request is made only if a text update is absolutely necessary.
+ return;
+ }
+
+ if(mIsManualRender || !(sizeChanged || mIsAsyncRenderNeeded))
+ {
+ // Do not request async render if the manual render is still ongoing or if there are no size or property updates.
+ return;
+ }
+
+ if(manualRendered && sizeChanged && !mIsAsyncRenderNeeded)
+ {
+ // Do not request async render if only the size has changed when manual render is completed.
+ // Users may attempt to change the size inside the completed callback post manual render.
+ // In case of ASYNC_AUTO, this could potentially trigger relayout and engender further computation.
+ // This is needed to avoid recomputations, but it may have some limitations.
+ return;
+ }
+
+ DALI_LOG_RELEASE_INFO("Request size : %f, %f\n", contentSize.width, contentSize.height);
+ AsyncTextParameters parameters = GetAsyncTextParameters(Async::RENDER_FIXED_SIZE, contentSize, padding, layoutDirection);
+ TextVisual::UpdateAsyncRenderer(mVisual, parameters);
+ mTextUpdateNeeded = false;
+ mIsAsyncRenderNeeded = false;
+ return;
+ }
+
if(mController->IsTextFitArrayEnabled())
{
mController->FitArrayPointSizeforLayout(contentSize);