public void Draw(TextView textView, DrawingContext drawingContext)
{
if (line > 0 && line < textView.TextDocument.LineCount)
{
var currentLine = textView.TextDocument.GetLineByNumber(line);
var rects = VisualLineGeometryBuilder.GetRectsForSegment(textView, currentLine);
foreach (var rect in rects)
{
var drawRect = new Rect(rect.TopLeft.X, rect.TopLeft.Y, textView.Bounds.Width, rect.Height);
drawingContext.FillRectangle(selectedLineBg, drawRect);
}
}
}