Underline predictive text.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / visual-model-impl.cpp
index bb7cdde..561beee 100644 (file)
@@ -149,13 +149,13 @@ void VisualModel::GetNumberOfLines( GlyphIndex glyphIndex,
   {
     const LineRun& line = *it;
 
-    if( ( line.glyphIndex + line.numberOfGlyphs > glyphIndex ) &&
-        ( lastGlyphIndex > line.glyphIndex ) )
+    if( ( line.glyphRun.glyphIndex + line.glyphRun.numberOfGlyphs > glyphIndex ) &&
+        ( lastGlyphIndex > line.glyphRun.glyphIndex ) )
     {
       firstLineFound = true;
       ++numberOfLines;
     }
-    else if( lastGlyphIndex <= line.glyphIndex )
+    else if( lastGlyphIndex <= line.glyphRun.glyphIndex )
     {
       // nothing else to do.
       break;
@@ -216,6 +216,15 @@ LineIndex VisualModel::GetLineOfCharacter( CharacterIndex characterIndex )
   return index;
 }
 
+void VisualModel::GetUnderlineRuns( GlyphRun* underlineRuns,
+                                    UnderlineRunIndex index,
+                                    Length numberOfRuns ) const
+{
+  memcpy( underlineRuns,
+          mUnderlineRuns.Begin() + index,
+          numberOfRuns * sizeof( GlyphRun ) );
+}
+
 void VisualModel::SetNaturalSize( const Vector2& size  )
 {
   mNaturalSize = size;