X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-view.cpp;h=2921700538004560e863647285289074156dbc0a;hp=88ab012bb3c752b902a741c796fa08290152cbd4;hb=d73cb8d5620abe0cce65941ce63ce2cf5de6690b;hpb=abf2533b2621e07a62a7ac65944959a18bd89673 diff --git a/dali-toolkit/internal/text/text-view.cpp b/dali-toolkit/internal/text/text-view.cpp index 88ab012..2921700 100644 --- a/dali-toolkit/internal/text/text-view.cpp +++ b/dali-toolkit/internal/text/text-view.cpp @@ -122,6 +122,30 @@ Length View::GetGlyphs( GlyphInfo* glyphs, glyphIndex, numberOfLaidOutGlyphs ); + // Set the colors. + const GlyphIndex lastLaidOutGlyphIndex = glyphIndex + numberOfLaidOutGlyphs; + + for( Vector::ConstIterator it = mImpl->mVisualModel->mColorRuns.Begin(), + endIt = mImpl->mVisualModel->mColorRuns.End(); + it != endIt; + ++it ) + { + const ColorGlyphRun& colorGlyphRun = *it; + const GlyphIndex lastGlyphIndex = colorGlyphRun.glyphRun.glyphIndex + colorGlyphRun.glyphRun.numberOfGlyphs; + + if( ( colorGlyphRun.glyphRun.glyphIndex < lastLaidOutGlyphIndex ) && + ( glyphIndex < lastGlyphIndex ) ) + { + for( GlyphIndex index = glyphIndex < colorGlyphRun.glyphRun.glyphIndex ? colorGlyphRun.glyphRun.glyphIndex : glyphIndex, + endIndex = lastLaidOutGlyphIndex < lastGlyphIndex ? lastLaidOutGlyphIndex : lastGlyphIndex; + index < endIndex; + ++index ) + { + *( glyphColors + index - glyphIndex ) = colorGlyphRun.color; + } + } + } + // Get the lines for the given range of glyphs. // The lines contain the alignment offset which needs to be added to the glyph's position. LineIndex firstLine = 0u;