- // Do the size related operations again.
- const OperationsMask sizeOperations = static_cast<OperationsMask>(LAYOUT |
- ALIGN |
- REORDER);
- operationsPending = static_cast<OperationsMask>(operationsPending | sizeOperations);
+ const OperationsMask sizeOperations = static_cast<OperationsMask>(LAYOUT |
+ ALIGN |
+ REORDER);
+
+ operationsPending = static_cast<OperationsMask>(operationsPending | sizeOperations);
+
+ // Restore the actual control's size.
+ visualModel->mControlSize = actualControlSize;
+
+ return calculatedLayoutSize;
+}
+
+Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller)
+{
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->Controller::GetNaturalSize\n");
+ Vector3 naturalSizeVec3;
+
+ // Make sure the model is up-to-date before layouting
+ EventHandler::ProcessModifyEvents(controller);
+
+ Controller::Impl& impl = *controller.mImpl;
+ ModelPtr& model = impl.mModel;
+ VisualModelPtr& visualModel = model->mVisualModel;
+
+ if(impl.mRecalculateNaturalSize)
+ {
+ Size naturalSize;
+
+ // Layout the text for the new width.
+ OperationsMask requestedOperationsMask = static_cast<OperationsMask>(LAYOUT | REORDER);
+ Size sizeMaxWidthAndMaxHeight = Size(MAX_FLOAT, MAX_FLOAT);
+
+ naturalSize = CalculateLayoutSizeOnRequiredControllerSize(controller, sizeMaxWidthAndMaxHeight, requestedOperationsMask);