AvalonStudio.TextEditor.Rendering.SelectedLineBackgroundRenderer.Draw C# (CSharp) 메소드

Draw() 공개 메소드

public Draw ( TextView textView, Avalonia.Media.DrawingContext drawingContext ) : void
textView TextView
drawingContext Avalonia.Media.DrawingContext
리턴 void
        public void Draw(TextView textView, DrawingContext drawingContext)
		{
			if (textView.SelectionStart == textView.SelectionEnd && textView.CaretIndex != -1 &&
				textView.CaretIndex <= textView.TextDocument.TextLength)
			{
				var currentLine = textView.TextDocument.GetLineByOffset(textView.CaretIndex);

				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);
				}
			}
		}