X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-selection-handle-controller.cpp;h=05d8ad502a813b79ecfe8dacdae7141ee29d16ad;hb=702cdc29b907688eef62afbc63f0edb9e2dfb7d2;hp=a36f81f1d92bc8a2766c4e1fc9ab0a1284ce67a2;hpb=22451f7abe0230b418d551d9eac0c685273e72f1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-selection-handle-controller.cpp b/dali-toolkit/internal/text/text-selection-handle-controller.cpp index a36f81f..05d8ad5 100644 --- a/dali-toolkit/internal/text/text-selection-handle-controller.cpp +++ b/dali-toolkit/internal/text/text-selection-handle-controller.cpp @@ -24,6 +24,7 @@ // INTERNAL INCLUDES #include #include +#include #include using namespace Dali; @@ -108,10 +109,13 @@ void SelectionHandleController::Reposition(Controller::Impl& impl) const GlyphIndex glyphStart = *(charactersToGlyphBuffer + selectionStart); const Length numberOfGlyphs = *(glyphsPerCharacterBuffer + selectionEndMinusOne); const GlyphIndex glyphEnd = *(charactersToGlyphBuffer + selectionEndMinusOne) + ((numberOfGlyphs > 0) ? numberOfGlyphs - 1u : 0u); - const float characterSpacing = visualModel->GetCharacterSpacing(); + const float modelCharacterSpacing = visualModel->GetCharacterSpacing(); Vector& glyphToCharacterMap = visualModel->mGlyphsToCharacters; const CharacterIndex* glyphToCharacterMapBuffer = glyphToCharacterMap.Begin(); + // Get the character-spacing runs. + const Vector& characterSpacingGlyphRuns = visualModel->GetCharacterSpacingGlyphRuns(); + // Get the lines where the glyphs are laid-out. const LineRun* lineRun = visualModel->mLines.Begin(); @@ -174,9 +178,10 @@ void SelectionHandleController::Reposition(Controller::Impl& impl) // Traverse the glyphs. for(GlyphIndex index = glyphStart; index <= glyphEnd; ++index) { - const GlyphInfo& glyph = *(glyphsBuffer + index); - const Vector2& position = *(positionsBuffer + index); - calculatedAdvance = GetCalculatedAdvance(*(logicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + index))), characterSpacing, glyph.advance); + const float characterSpacing = GetGlyphCharacterSpacing(index, characterSpacingGlyphRuns, modelCharacterSpacing); + const GlyphInfo& glyph = *(glyphsBuffer + index); + const Vector2& position = *(positionsBuffer + index); + calculatedAdvance = GetCalculatedAdvance(*(logicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + index))), characterSpacing, glyph.advance); if(splitStartGlyph) {