AvalonStudio.TextEditor.Rendering.VisualLineGeometryBuilder.GetTextPositionInViewPort C# (CSharp) Method

GetTextPositionInViewPort() public static method

public static GetTextPositionInViewPort ( TextView textView, TextViewPosition position ) : Avalonia.Rect
textView TextView
position TextViewPosition
return Avalonia.Rect
        public static Rect GetTextPositionInViewPort(TextView textView, TextViewPosition position)
        {
            if (position.Line - 1 < textView.VisualLines.Count)
            {
                return new Rect(textView.VisualLines[position.Line - 1].RenderedText.HitTestTextPosition(position.Column - 1).X + textView.TextSurfaceBounds.X,
                    textView.CharSize.Height * (position.Line - 1),
                    textView.CharSize.Width,
                    textView.CharSize.Height);
            }

            return new Rect(textView.TextSurfaceBounds.X + textView.CharSize.Width * (position.Column - 1),
                textView.CharSize.Height * (position.Line - 1),
                textView.CharSize.Width,
                textView.CharSize.Height);
        }