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.cpp;h=13d0ab2a87c436258219f0fbc6c3a9b6300af115;hp=227760fe1872557d9bbc2946b5d54b44a558145f;hb=fe706c2b9e0a2ce31c91317dd6749faecef6d92e;hpb=ef26ad3f7e7de375b10d1f17052a78915eae2976 diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 227760f..13d0ab2 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -417,6 +417,22 @@ void Controller::SetIgnoreSpacesAfterText( bool ignore ) mImpl->mModel->mIgnoreSpacesAfterText = ignore; } +bool Controller::IsMatchSystemLanguageDirection() const +{ + return mImpl->mModel->mMatchSystemLanguageDirection; +} + +void Controller::SetMatchSystemLanguageDirection( bool match ) +{ + mImpl->mModel->mMatchSystemLanguageDirection = match; +} + +void Controller::SetLayoutDirection( Dali::LayoutDirection::Type layoutDirection ) +{ + mImpl->mLayoutDirection = layoutDirection; +} + + void Controller::SetLineWrapMode( Text::LineWrap::Mode lineWrapMode ) { if( lineWrapMode != mImpl->mModel->mLineWrapMode ) @@ -2228,12 +2244,13 @@ void Controller::SetVerticalLineAlignment( Toolkit::DevelText::VerticalLineAlign // public : Relayout. -Controller::UpdateTextType Controller::Relayout( const Size& size ) +Controller::UpdateTextType Controller::Relayout( const Size& size, Dali::LayoutDirection::Type layoutDirection ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f, autoScroll[%s]\n", this, size.width, size.height, mImpl->mIsAutoScrollEnabled ?"true":"false" ); UpdateTextType updateTextType = NONE_UPDATED; + mImpl->mLayoutDirection = layoutDirection; if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) ) { if( 0u != mImpl->mModel->mVisualModel->mGlyphPositions.Count() ) @@ -2311,6 +2328,7 @@ Controller::UpdateTextType Controller::Relayout( const Size& size ) mImpl->mOperationsPending, layoutSize ) || updated; + if( updated ) { updateTextType = MODEL_UPDATED; @@ -2412,6 +2430,7 @@ void Controller::KeyboardFocusGainEvent() mImpl->ChangeState( EventData::EDITING ); mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered. mImpl->mEventData->mUpdateInputStyle = true; + mImpl->mEventData->mScrollAfterUpdatePosition = true; } mImpl->NotifyInputMethodContextMultiLineStatus(); if( mImpl->IsShowingPlaceholderText() ) @@ -3529,8 +3548,7 @@ bool Controller::DoRelayout( const Size& size, const float outlineWidth = static_cast( mImpl->mModel->GetOutlineWidth() ); // Set the layout parameters. - const Vector2 sizeOffset = Vector2(outlineWidth * 2.0f, outlineWidth * 2.0f); // The outline should be fit into the bounding box - Layout::Parameters layoutParameters( size - sizeOffset, + Layout::Parameters layoutParameters( size, textBuffer, lineBreakInfo.Begin(), wordBreakInfo.Begin(), @@ -3544,7 +3562,8 @@ bool Controller::DoRelayout( const Size& size, mImpl->mModel->mHorizontalAlignment, mImpl->mModel->mLineWrapMode, outlineWidth, - mImpl->mModel->mIgnoreSpacesAfterText ); + mImpl->mModel->mIgnoreSpacesAfterText, + mImpl->mModel->mMatchSystemLanguageDirection ); // Resize the vector of positions to have the same size than the vector of glyphs. Vector& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions; @@ -3583,12 +3602,15 @@ bool Controller::DoRelayout( const Size& size, } // Update the visual model. + bool isAutoScrollEnabled = mImpl->mIsAutoScrollEnabled; Size newLayoutSize; viewUpdated = mImpl->mLayoutEngine.LayoutText( layoutParameters, glyphPositions, mImpl->mModel->mVisualModel->mLines, newLayoutSize, - elideTextEnabled ); + elideTextEnabled, + isAutoScrollEnabled ); + mImpl->mIsAutoScrollEnabled = isAutoScrollEnabled; viewUpdated = viewUpdated || ( newLayoutSize != layoutSize ); @@ -3662,7 +3684,9 @@ bool Controller::DoRelayout( const Size& size, requestedNumberOfCharacters, mImpl->mModel->mHorizontalAlignment, lines, - mImpl->mModel->mAlignmentOffset ); + mImpl->mModel->mAlignmentOffset, + mImpl->mLayoutDirection, + mImpl->mModel->mMatchSystemLanguageDirection ); viewUpdated = true; }