From: Bowon Ryu Date: Tue, 26 Sep 2023 06:50:32 +0000 (+0900) Subject: Revert "Fix GetHeightForWidth for text controller" X-Git-Tag: dali_2.2.46~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=da4f1bbf658462bebfc59e1e9c9c7dea7c4c6ab8 Revert "Fix GetHeightForWidth for text controller" This reverts commit da9f7b93ae00d0aa64a959549ed9da3469a49e46. Change-Id: I9dbcb715d65c97ff40ba9746caab50ce7231c1af --- diff --git a/dali-toolkit/internal/text/controller/text-controller-impl.h b/dali-toolkit/internal/text/controller/text-controller-impl.h index 0f910d0..97010cc 100644 --- a/dali-toolkit/internal/text/controller/text-controller-impl.h +++ b/dali-toolkit/internal/text/controller/text-controller-impl.h @@ -341,7 +341,6 @@ struct Controller::Impl mMaximumNumberOfCharacters(50u), mHiddenInput(NULL), mInputFilter(nullptr), - mLastHeightForWidth(0.0f, 0.0f), mRecalculateNaturalSize(true), mMarkupProcessorEnabled(false), mClipboardHideEnabled(true), @@ -1025,7 +1024,6 @@ public: HiddenText* mHiddenInput; ///< Avoid allocating this when the user does not specify hidden input mode. std::unique_ptr mInputFilter; ///< Avoid allocating this when the user does not specify input filter mode. Vector2 mTextFitContentSize; ///< Size of Text fit content - Vector2 mLastHeightForWidth; ///< Size of Text content from GetHeightForWidth bool mRecalculateNaturalSize : 1; ///< Whether the natural size needs to be recalculated. bool mMarkupProcessorEnabled : 1; ///< Whether the mark-up procesor is enabled. diff --git a/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp b/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp index c3711f3..d595d00 100644 --- a/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp +++ b/dali-toolkit/internal/text/controller/text-controller-relayouter.cpp @@ -345,11 +345,13 @@ float Controller::Relayouter::GetHeightForWidth(Controller& controller, float wi EventHandler::ProcessModifyEvents(controller); Controller::Impl& impl = *controller.mImpl; + ModelPtr& model = impl.mModel; + VisualModelPtr& visualModel = model->mVisualModel; TextUpdateInfo& textUpdateInfo = impl.mTextUpdateInfo; Size layoutSize; - if(fabsf(width - impl.mLastHeightForWidth.width) > Math::MACHINE_EPSILON_1000 || + if(fabsf(width - visualModel->mControlSize.width) > Math::MACHINE_EPSILON_1000 || textUpdateInfo.mFullRelayoutNeeded || textUpdateInfo.mClearAll) { @@ -358,14 +360,12 @@ float Controller::Relayouter::GetHeightForWidth(Controller& controller, float wi Size sizeRequestedWidthAndMaxHeight = Size(width, MAX_FLOAT); layoutSize = CalculateLayoutSizeOnRequiredControllerSize(controller, sizeRequestedWidthAndMaxHeight, requestedOperationsMask); - impl.mLastHeightForWidth.width = width; - impl.mLastHeightForWidth.height = layoutSize.height; DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::GetHeightForWidth calculated %f\n", layoutSize.height); } else { - layoutSize = impl.mLastHeightForWidth; + layoutSize = visualModel->GetLayoutSize(); DALI_LOG_INFO(gLogFilter, Debug::Verbose, "<--Controller::GetHeightForWidth cached %f\n", layoutSize.height); }