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-background-actor.cpp;h=7def7e8bdc51835002c11a33b655d445713aba07;hp=a129c5e329a131e6a7039910e4da217198c5b308;hb=1d6351bc6c29b125b71b266f4a8d0f25413e099d;hpb=297bb57457856f35d1a72c2879be26c32ae329ff diff --git a/dali-toolkit/internal/text/text-controller-background-actor.cpp b/dali-toolkit/internal/text/text-controller-background-actor.cpp index a129c5e..7def7e8 100644 --- a/dali-toolkit/internal/text/text-controller-background-actor.cpp +++ b/dali-toolkit/internal/text/text-controller-background-actor.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include namespace Dali::Toolkit::Text @@ -98,11 +99,14 @@ Actor CreateControllerBackgroundActor(const View& textView, const VisualModelPtr const Vector4* const backgroundColorsBuffer = textView.GetBackgroundColors(); const ColorIndex* const backgroundColorIndicesBuffer = textView.GetBackgroundColorIndices(); const Vector4& defaultBackgroundColor = textVisualModel->IsBackgroundEnabled() ? textVisualModel->GetBackgroundColor() : Color::TRANSPARENT; - const float characterSpacing = textVisualModel->GetCharacterSpacing(); + const float modelCharacterSpacing = textVisualModel->GetCharacterSpacing(); Vector& glyphToCharacterMap = textVisualModel->mGlyphsToCharacters; const CharacterIndex* glyphToCharacterMapBuffer = glyphToCharacterMap.Begin(); float calculatedAdvance = 0.f; + // Get the character-spacing runs. + const Vector& characterSpacingGlyphRuns = textVisualModel->GetCharacterSpacingGlyphRuns(); + Vector4 quad; uint32_t numberOfQuads = 0u; Length yLineOffset = 0; @@ -137,6 +141,8 @@ Actor CreateControllerBackgroundActor(const View& textView, const VisualModelPtr // Only create quads for glyphs with a background color if(backgroundColor != Color::TRANSPARENT) { + const float characterSpacing = GetGlyphCharacterSpacing(i, characterSpacingGlyphRuns, modelCharacterSpacing); + const Vector2 position = *(positionsBuffer + i); calculatedAdvance = GetCalculatedAdvance(*(textLogicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + i))), characterSpacing, glyph.advance);