remove unreachable code in text geometry
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-geometry.cpp
index 359d992..3635d0c 100644 (file)
@@ -428,7 +428,7 @@ int GetCharIndexAtPosition(ModelPtr textModel, float visualX, float visualY)
   const Vector<LineRun>& lines = visualModel->mLines;
 
   float lineTop   = 0.f;
-  int   lineIndex = -1;
+  int   lineIndex = 0;
   int   high      = totalNumberOfLines;
   int   low       = -1;
   int   guess;
@@ -474,12 +474,6 @@ int GetCharIndexAtPosition(ModelPtr textModel, float visualX, float visualY)
     }
   }
 
-  // Check if a line is not found; return -1.
-  if(lineIndex == -1)
-  {
-    return -1;
-  }
-
  // Start searching for the visualX
   const LineRun& line = *(visualModel->mLines.Begin() + lineIndex);