From: v.cebollada Date: Thu, 27 Aug 2015 07:19:25 +0000 (+0900) Subject: Fixes some alignment issues. X-Git-Tag: dali_1.1.2~16^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=0ba2c873ec2b627f3dd130761c14cc30c32554da Fixes some alignment issues. * Align decorator when text-field's size changes. * Fixes the text's scroll position when the text-field's size changes. Change-Id: Iede1a116b6855da47a689e4da7e70775e13ed821 Signed-off-by: v.cebollada --- diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index e3b29bd..ccc60fa 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -641,11 +641,24 @@ bool Controller::Relayout( const Size& size ) // Do not re-do any operation until something changes. mImpl->mOperationsPending = NO_OPERATION; + // Keep the current offset and alignment as it will be used to update the decorator's positions. + Vector2 offset; + if( mImpl->mEventData ) + { + offset = mImpl->mAlignmentOffset + mImpl->mEventData->mScrollPosition; + } + // After doing the text layout, the alignment offset to place the actor in the desired position can be calculated. CalculateTextAlignment( size ); if( mImpl->mEventData ) { + // If there is a nex size, the scroll position needs to be clamped. + mImpl->ClampHorizontalScroll( layoutSize ); + + // Update the decorator's positions. + mImpl->mEventData->mDecorator->UpdatePositions( mImpl->mAlignmentOffset + mImpl->mEventData->mScrollPosition - offset ); + // Move the cursor, grab handle etc. updated = mImpl->ProcessInputEvents() || updated; }