X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-relayouter.cpp;h=227d889b99d1f91909c2495c9ea12b1c8cfe523b;hp=a9006013119b29cbe007a288c0ee14012f80a22e;hb=c570552b94d9532440de9440b845c4fc06f8d411;hpb=2181d2ac56e0efca21307dd75b1ecc46bee57b9f diff --git a/dali-toolkit/internal/text/text-controller-relayouter.cpp b/dali-toolkit/internal/text/text-controller-relayouter.cpp index a900601..227d889 100644 --- a/dali-toolkit/internal/text/text-controller-relayouter.cpp +++ b/dali-toolkit/internal/text/text-controller-relayouter.cpp @@ -61,6 +61,9 @@ Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller) VisualModelPtr& visualModel = model->mVisualModel; if(impl.mRecalculateNaturalSize) { + // Store the pending operations mask so that it can be restored later on with no modifications made on it + // while getting the natural size were reflected on the original mask. + OperationsMask operationsPendingBackUp = static_cast(impl.mOperationsPending); // Operations that can be done only once until the text changes. const OperationsMask onlyOnceOperations = static_cast(CONVERT_TO_UTF32 | GET_SCRIPTS | @@ -93,15 +96,6 @@ Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller) LAYOUT | REORDER), naturalSize.GetVectorXY()); - // Do not do again the only once operations. - operationsPending = static_cast(operationsPending & ~onlyOnceOperations); - - // Do the size related operations again. - const OperationsMask sizeOperations = static_cast(LAYOUT | - ALIGN | - REORDER); - operationsPending = static_cast(operationsPending | sizeOperations); - // Stores the natural size to avoid recalculate it again // unless the text/style changes. visualModel->SetNaturalSize(naturalSize.GetVectorXY()); @@ -114,7 +108,8 @@ Vector3 Controller::Relayouter::GetNaturalSize(Controller& controller) // Restore the actual control's size. visualModel->mControlSize = actualControlSize; - + // Restore the previously backed-up pending operations' mask without the only once operations. + impl.mOperationsPending = static_cast(operationsPendingBackUp & ~onlyOnceOperations); DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize calculated %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z); } else @@ -244,6 +239,9 @@ float Controller::Relayouter::GetHeightForWidth(Controller& controller, float wi textUpdateInfo.mFullRelayoutNeeded || textUpdateInfo.mClearAll) { + // Store the pending operations mask so that it can be restored later on with no modifications made on it + // while getting the natural size were reflected on the original mask. + OperationsMask operationsPendingBackUp = static_cast(impl.mOperationsPending); // Operations that can be done only once until the text changes. const OperationsMask onlyOnceOperations = static_cast(CONVERT_TO_UTF32 | GET_SCRIPTS | @@ -275,23 +273,14 @@ float Controller::Relayouter::GetHeightForWidth(Controller& controller, float wi LAYOUT), layoutSize); - // Do not do again the only once operations. - operationsPending = static_cast(operationsPending & ~onlyOnceOperations); - - // Do the size related operations again. - const OperationsMask sizeOperations = static_cast(LAYOUT | - ALIGN | - REORDER); - - operationsPending = static_cast(operationsPending | sizeOperations); - // Clear the update info. This info will be set the next time the text is updated. textUpdateInfo.Clear(); textUpdateInfo.mClearAll = true; // Restore the actual control's width. visualModel->mControlSize.width = actualControlWidth; - + // Restore the previously backed-up pending operations' mask without the only once operations. + impl.mOperationsPending = static_cast(operationsPendingBackUp & ~onlyOnceOperations); DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::GetHeightForWidth calculated %f\n", layoutSize.height); } else