}
}
+void UpdateCursorPositionForAlignment(Controller::Impl& impl, bool needFullAlignment)
+{
+ EventData* eventData = impl.mEventData;
+
+ // Set the flag to redo the alignment operation
+ impl.mOperationsPending = static_cast<Controller::OperationsMask>(impl.mOperationsPending | Controller::OperationsMask::ALIGN);
+
+ if(eventData)
+ {
+ // Note: mUpdateAlignment is currently only needed for horizontal alignment
+ eventData->mUpdateAlignment = needFullAlignment;
+
+ // Update the cursor if it's in editing mode
+ if(EventData::IsEditingState(eventData->mState))
+ {
+ impl.ChangeState(EventData::EDITING);
+ eventData->mUpdateCursorPosition = true;
+ }
+ }
+}
+
} // unnamed Namespace
EventData::EventData(DecoratorPtr decorator, InputMethodContext& inputMethodContext)
if(mModel->mMatchLayoutDirection == DevelText::MatchLayoutDirection::LOCALE ||
(mModel->mMatchLayoutDirection == DevelText::MatchLayoutDirection::INHERIT && !mIsLayoutDirectionChanged))
{
- return static_cast<Dali::LayoutDirection::Type>(DevelWindow::Get(actor).GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
+ Window window = DevelWindow::Get(actor);
+ return static_cast<Dali::LayoutDirection::Type>(window ? window.GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>() : LayoutDirection::LEFT_TO_RIGHT);
}
else
{
{
mModel->mScrollPosition.y = mModel->mVisualModel->mControlSize.height - positionEndY;
}
+ else if(mModel->mLogicalModel->mText.Count() == 0u)
+ {
+ Relayouter::CalculateVerticalOffset(*this, mModel->mVisualModel->mControlSize);
+ }
}
}
{
// Set the alignment.
mModel->mHorizontalAlignment = alignment;
-
- // Set the flag to redo the alignment operation.
- mOperationsPending = static_cast<OperationsMask>(mOperationsPending | ALIGN);
-
- if(mEventData)
- {
- mEventData->mUpdateAlignment = true;
-
- // Update the cursor if it's in editing mode
- if(EventData::IsEditingState(mEventData->mState))
- {
- ChangeState(EventData::EDITING);
- mEventData->mUpdateCursorPosition = true;
- }
- }
-
+ UpdateCursorPositionForAlignment(*this, true);
RequestRelayout();
}
}
{
// Set the alignment.
mModel->mVerticalAlignment = alignment;
- mOperationsPending = static_cast<OperationsMask>(mOperationsPending | ALIGN);
+ UpdateCursorPositionForAlignment(*this, false);
RequestRelayout();
}
}