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=033433b690f806990f82084a2bbe87c3ec831c8c;hp=d87802512ecf05ce41449ae35e214bb13a8dd80b;hb=0686e6d654472bffc56910890f39031ceac32d3b;hpb=09fea2d3984ac0100f87f480335d674cbb9384a1 diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index d878025..033433b 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -168,7 +168,14 @@ void Controller::SetGlyphType( TextAbstraction::GlyphType glyphType ) void Controller::SetMarkupProcessorEnabled( bool enable ) { - mImpl->mMarkupProcessorEnabled = enable; + if( enable != mImpl->mMarkupProcessorEnabled ) + { + //If Text was already set, call the SetText again for enabling or disabling markup + mImpl->mMarkupProcessorEnabled = enable; + std::string text; + GetText( text ); + SetText( text ); + } } bool Controller::IsMarkupProcessorEnabled() const @@ -400,6 +407,16 @@ VerticalAlignment::Type Controller::GetVerticalAlignment() const return mImpl->mModel->mVerticalAlignment; } +bool Controller::IsIgnoreSpacesAfterText() const +{ + return mImpl->mModel->mIgnoreSpacesAfterText; +} + +void Controller::SetIgnoreSpacesAfterText( bool ignore ) +{ + mImpl->mModel->mIgnoreSpacesAfterText = ignore; +} + void Controller::SetLineWrapMode( Text::LineWrap::Mode lineWrapMode ) { if( lineWrapMode != mImpl->mModel->mLineWrapMode ) @@ -1983,6 +2000,7 @@ float Controller::GetHeightForWidth( float width ) // Clear the update info. This info will be set the next time the text is updated. mImpl->mTextUpdateInfo.Clear(); + mImpl->mTextUpdateInfo.mClearAll = true; // Restore the actual control's width. mImpl->mModel->mVisualModel->mControlSize.width = actualControlWidth; @@ -3511,8 +3529,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(), @@ -3525,7 +3542,8 @@ bool Controller::DoRelayout( const Size& size, totalNumberOfGlyphs, mImpl->mModel->mHorizontalAlignment, mImpl->mModel->mLineWrapMode, - outlineWidth ); + outlineWidth, + mImpl->mModel->mIgnoreSpacesAfterText ); // Resize the vector of positions to have the same size than the vector of glyphs. Vector& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions;