Use non-bordered drawings for the search result geometry

This commit is contained in:
Daniel 2023-03-02 09:40:56 +01:00
Родитель 8d2c6bbf76
Коммит b3f746bc0f
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -35,11 +35,9 @@ namespace AvaloniaEdit.Search
public SearchResultBackgroundRenderer(IBrush brush)
{
_markerBrush = brush;
_markerPen = new Pen(_markerBrush);
}
private IBrush _markerBrush;
private Pen _markerPen;
public IBrush MarkerBrush
{
@ -47,7 +45,6 @@ namespace AvaloniaEdit.Search
set
{
_markerBrush = value;
_markerPen = new Pen(_markerBrush);
}
}
@ -73,14 +70,13 @@ namespace AvaloniaEdit.Search
var geoBuilder = new BackgroundGeometryBuilder
{
AlignToWholePixels = true,
BorderThickness = _markerPen?.Thickness ?? 0,
CornerRadius = 0
};
geoBuilder.AddSegment(textView, result);
var geometry = geoBuilder.CreateGeometry();
if (geometry != null)
{
drawingContext.DrawGeometry(_markerBrush, _markerPen, geometry);
drawingContext.DrawGeometry(_markerBrush, null, geometry);
}
}
}