From ae878aedb70cdcb83600c30c11309abb8eb9f818 Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Mon, 21 Sep 2015 14:11:09 +0100 Subject: [PATCH 1/1] Modify the cursor position. * Set a top left anchor point to not to overlap characters. Change-Id: Ib37fdbf31f0b468b4d4850cf009a8c97b5c88f65 Signed-off-by: Victor Cebollada --- dali-toolkit/internal/text/decorator/text-decorator.cpp | 2 +- dali-toolkit/internal/text/text-controller-impl.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index 441d179..c94129f 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -495,7 +495,7 @@ struct Decorator::Impl : public ConnectionTracker cursor = CreateSolidColorActor( color ); cursor.SetSortModifier( DECORATION_DEPTH_INDEX ); cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one. - cursor.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + cursor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); } // Add or Remove cursor(s) from parent diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index e533a3f..bd66860 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -1527,7 +1527,7 @@ void Controller::Impl::GetCursorPosition( CharacterIndex logical, cursorInfo.lineHeight = GetDefaultFontLineHeight(); cursorInfo.primaryCursorHeight = cursorInfo.lineHeight; - cursorInfo.primaryPosition.x = mEventData->mDecorator->GetCursorWidth(); + cursorInfo.primaryPosition.x = 0.f; cursorInfo.primaryPosition.y = 0.f; // Nothing else to do. @@ -1796,7 +1796,7 @@ void Controller::Impl::UpdateCursorPosition() { case LayoutEngine::HORIZONTAL_ALIGN_BEGIN: { - cursorPosition.x = mEventData->mDecorator->GetCursorWidth(); + cursorPosition.x = 0.f; break; } case LayoutEngine::HORIZONTAL_ALIGN_CENTER: @@ -1806,7 +1806,7 @@ void Controller::Impl::UpdateCursorPosition() } case LayoutEngine::HORIZONTAL_ALIGN_END: { - cursorPosition.x = mVisualModel->mControlSize.width; + cursorPosition.x = mVisualModel->mControlSize.width - mEventData->mDecorator->GetCursorWidth(); break; } } -- 2.7.4