Commit 34f2348
Paint full visual-line box, eliminating inter-line gaps
The two background renderers used
BackgroundGeometryBuilder.GetRectsFromVisualSegment(textView,
visualLine, 0, int.MaxValue) to enumerate the text-segment rectangles
for each visual line. Those rectangles are sized to the text-segment
bounding box, which on some DPI / line-spacing combinations does not
cover the full vertical extent of the line box -- leaving a 1-2 px
sliver of untinted background between adjacent diff-tinted rows. With
the soft tints those slivers were effectively invisible; with the new
strong full-line tints they were obvious horizontal "stripes" between
every row in a delete or insert block.
Switch both renderers to paint a single rectangle per visual line at
(0, VisualTop - ScrollOffset.Y) sized (ActualWidth, Height).
VisualLine.Height is the height of the entire line box, including
all wrapped sub-rows for the document line, so this also correctly
handles word-wrap (one DocumentLine that spans multiple visual rows
gets one rectangle covering all of them, which is the same behavior
the segment-rect loop had).
No tests added for the rendering itself -- exercising AvalonEdit's
VisualLine.VisualTop / Height accurately would require spinning up a
real TextView with measured layout, which the test project
deliberately avoids. The brush-selection logic (the only piece worth
unit-testing here) is already covered by
LineBackgroundBrushSelectorTests.
AI-Local-Session: 4519f6b6-393a-4476-8efa-410e5396c3a9
AI-Cloud-Session: 72f9e474-60ab-42c2-b2a0-28fee827cbbb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 84a1704 commit 34f2348
3 files changed
Lines changed: 35 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
0 commit comments