X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-impl.cpp;h=db6fde1c81297e6967136ffe041522ecd59ffd15;hb=960870f0f39490cf3679ab54b3f32c258bb4ab03;hp=6ffa7155844661c229b4099aeeb079d750edeb5a;hpb=fa834a987e844fb79531954c882581624aef0e68;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 6ffa715..db6fde1 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -22,11 +22,13 @@ #include #include #include +#include #include // INTERNAL INCLUDES #include #include +#include #include #include #include @@ -691,7 +693,7 @@ bool Controller::Impl::SetDefaultLineSpacing(float lineSpacing) { mLayoutEngine.SetDefaultLineSpacing(lineSpacing); - RelayoutForNewLineSize(); + RelayoutAllCharacters(); return true; } return false; @@ -703,7 +705,7 @@ bool Controller::Impl::SetDefaultLineSize(float lineSize) { mLayoutEngine.SetDefaultLineSize(lineSize); - RelayoutForNewLineSize(); + RelayoutAllCharacters(); return true; } return false; @@ -1461,7 +1463,7 @@ void Controller::Impl::RequestRelayout() } } -void Controller::Impl::RelayoutForNewLineSize() +void Controller::Impl::RelayoutAllCharacters() { // relayout all characters mTextUpdateInfo.mCharacterIndex = 0; @@ -1626,6 +1628,34 @@ void Controller::Impl::CopyUnderlinedFromLogicalToVisualModels(bool shouldClearP } } +void Controller::Impl::CopyStrikethroughFromLogicalToVisualModels() +{ + //Strikethrough character runs from markup-processor + const Vector& strikethroughCharacterRuns = mModel->mLogicalModel->mStrikethroughCharacterRuns; + const Vector& charactersToGlyph = mModel->mVisualModel->mCharactersToGlyph; + const Vector& glyphsPerCharacter = mModel->mVisualModel->mGlyphsPerCharacter; + + mModel->mVisualModel->mStrikethroughRuns.Clear(); + + for(Vector::ConstIterator it = strikethroughCharacterRuns.Begin(), endIt = strikethroughCharacterRuns.End(); it != endIt; ++it) + { + CharacterIndex characterIndex = it->characterRun.characterIndex; + Length numberOfCharacters = it->characterRun.numberOfCharacters; + StrikethroughGlyphRun strikethroughGlyphRun; + strikethroughGlyphRun.color = it->color; + strikethroughGlyphRun.isColorSet = it->isColorSet; + strikethroughGlyphRun.glyphRun.glyphIndex = charactersToGlyph[characterIndex]; + strikethroughGlyphRun.glyphRun.numberOfGlyphs = glyphsPerCharacter[characterIndex]; + + for(Length index = 1u; index < numberOfCharacters; index++) + { + strikethroughGlyphRun.glyphRun.numberOfGlyphs += glyphsPerCharacter[characterIndex + index]; + } + + mModel->mVisualModel->mStrikethroughRuns.PushBack(strikethroughGlyphRun); + } +} + void Controller::Impl::SetAutoScrollEnabled(bool enable) { if(mLayoutEngine.GetLayout() == Layout::Engine::SINGLE_LINE_BOX)