fix: background not fill entire text line (#364)

This commit is contained in:
leo 2024-08-16 17:28:00 +08:00
parent 6d11296eae
commit 9f39a9b295
No known key found for this signature in database

View file

@ -172,8 +172,9 @@ namespace SourceGit.Views
if (bg == null) if (bg == null)
continue; continue;
var y = line.GetTextLineVisualYPosition(line.TextLines[0], VisualYPosition.TextTop) - textView.VerticalOffset; var startY = line.GetTextLineVisualYPosition(line.TextLines[0], VisualYPosition.LineTop) - textView.VerticalOffset;
drawingContext.DrawRectangle(bg, null, new Rect(0, y, width, line.Height)); var endY = line.GetTextLineVisualYPosition(line.TextLines[^1], VisualYPosition.LineBottom) - textView.VerticalOffset;
drawingContext.DrawRectangle(bg, null, new Rect(0, startY, width, endY - startY));
} }
} }