public TextPoint IntPosToPoint(int pos)
{
int p = 0;
int y = 0;
foreach (Row r in this)
{
p += r.Text.Length + Environment.NewLine.Length;
if (p > pos)
{
p -= r.Text.Length + Environment.NewLine.Length;
int x = pos - p;
return new TextPoint(x, y);
}
y++;
}
return new TextPoint(-1, -1);
}