From: ANZ1217 Date: Fri, 12 Jan 2024 03:38:17 +0000 (+0900) Subject: Revert "Fix Text Anchor don't work properly" X-Git-Tag: accepted/tizen/7.0/unified/20240115.170644~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=928197ad16bd17ee6b6969e84ba3f53be7c6d84f;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Revert "Fix Text Anchor don't work properly" This reverts commit 1d65ac99b64735697e4ba7db7a5a5ca8d8dba677. --- diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index b787366..fbebd86 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -1138,8 +1138,6 @@ void TextLabel::OnRelayout(const Vector2& size, RelayoutContainer& container) visualTransformOffset.x = roundf(padding.start + alignmentOffset.x); visualTransformOffset.y = roundf(padding.top + alignmentOffset.y); - mController->SetVisualTransformOffset(visualTransformOffset); - Property::Map visualTransform; visualTransform.Add(Toolkit::Visual::Transform::Property::SIZE, layoutSize) .Add(Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE)) diff --git a/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp b/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp index 9708844..dddb7da 100644 --- a/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp +++ b/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp @@ -377,19 +377,16 @@ void Controller::EventHandler::AnchorEvent(Controller& controller, float x, floa CharacterIndex cursorPosition = 0u; // Convert from control's coords to text's coords. - const float xPosition = x - controller.mImpl->mModel->mScrollPosition.x; const float yPosition = y - controller.mImpl->mModel->mScrollPosition.y; - Vector2 visualTransformOffset = controller.mImpl->mModel->mVisualTransformOffset; - // Whether to touch point hits on a glyph. bool matchedCharacter = false; cursorPosition = Text::GetClosestCursorIndex(controller.mImpl->mModel->mVisualModel, controller.mImpl->mModel->mLogicalModel, controller.mImpl->mMetrics, xPosition, - yPosition - visualTransformOffset.y, + yPosition, CharacterHitTest::TAP, matchedCharacter); diff --git a/dali-toolkit/internal/text/controller/text-controller.cpp b/dali-toolkit/internal/text/controller/text-controller.cpp index d4082fb..399e871 100644 --- a/dali-toolkit/internal/text/controller/text-controller.cpp +++ b/dali-toolkit/internal/text/controller/text-controller.cpp @@ -1416,11 +1416,6 @@ const float Controller::GetCharacterSpacing() const return mImpl->mModel->mVisualModel->GetCharacterSpacing(); } -void Controller::SetVisualTransformOffset(Vector2 offset) -{ - mImpl->mModel->mVisualTransformOffset = offset; -} - Controller::UpdateTextType Controller::Relayout(const Size& size, Dali::LayoutDirection::Type layoutDirection) { return Relayouter::Relayout(*this, size, layoutDirection); diff --git a/dali-toolkit/internal/text/controller/text-controller.h b/dali-toolkit/internal/text/controller/text-controller.h index b6f0aff..38b1e98 100644 --- a/dali-toolkit/internal/text/controller/text-controller.h +++ b/dali-toolkit/internal/text/controller/text-controller.h @@ -1574,13 +1574,6 @@ public: // Default style & Input style */ const float GetCharacterSpacing() const; - /** - * @brief Sets the visual transform offset. - * - * @param[in] offset The offset. - */ - void SetVisualTransformOffset(Vector2 offset); - public: // Queries & retrieves. /** * @brief Return the layout engine. diff --git a/dali-toolkit/internal/text/text-model.h b/dali-toolkit/internal/text/text-model.h index 92a514a..a3a42a2 100644 --- a/dali-toolkit/internal/text/text-model.h +++ b/dali-toolkit/internal/text/text-model.h @@ -380,7 +380,6 @@ public: bool mIgnoreSpacesAfterText : 1; ///< Whether ignoring spaces after text or not. Default is true. DevelText::MatchLayoutDirection mMatchLayoutDirection; ///< Whether to match text alignment with layout direction or not. DevelText::EllipsisPosition::Type mEllipsisPosition; ///< Where is the location the text elide - Vector2 mVisualTransformOffset; ///< The offset of the layout based on the controller due to alignment. }; } // namespace Text