Beispiel #1
0
        static int GetProperSplitBoundIndex(List <LayoutFarm.Composers.TextSplitBounds> _textSplitBoundsList, int charIndex)
        {
            int j         = _textSplitBoundsList.Count;
            int accumChar = 0;

            for (int i = 0; i < j; ++i)
            {
                LayoutFarm.Composers.TextSplitBounds splittedBound = _textSplitBoundsList[i];
                if (accumChar + splittedBound.length >= charIndex)
                {
                    return(i);
                }
                accumChar += splittedBound.length;
            }
            return(-1);//not found?
        }
Beispiel #2
0
 static string GetString(char[] buffer, LayoutFarm.Composers.TextSplitBounds bound)
 {
     return(new string(buffer, bound.startIndex, bound.length));
 }