public static Rect GetViewPortPosition(TextView textView, int offset) { var position = new TextViewPosition(textView.GetLocation(offset)); return(GetTextPositionInViewPort(textView, position)); }
public static Rect GetTextPositionInViewPort(TextView textView, TextViewPosition position) { return(new Rect(textView.TextSurfaceBounds.X + textView.CharSize.Width * (position.Column - 1), textView.CharSize.Height * (position.Line - 1), textView.CharSize.Width, textView.CharSize.Height)); }