Commit 35e658a
committed
Fix InsideStrokedRectangle to inset stroke under any transform
The previous implementation shrank the rectangle's bounds by lw/2 in data
units, which only happens to be correct in the DrawingArea's
points-as-units transform; under transData, transAxes, or any other
transform it inset by the wrong amount. It also failed to restore the
bounds after drawing, so each redraw shrank the patch further.
Replace it with a clip-to-self approach: stroke at 2·lw centred on the
path, then clip to the patch's own boundary so the outer half is erased.
The visible stroke ends up fully inside the rectangle with its outer edge
on the original boundary, in any transform, idempotently across redraws.
Snapshot and restore _dash_pattern around the linewidth change so dashed
strokes render at the requested length rather than 2× longer.1 parent efed6a9 commit 35e658a
3 files changed
Lines changed: 31 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
121 | 127 | | |
122 | | - | |
123 | | - | |
124 | 128 | | |
125 | | - | |
126 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
Loading
Loading
0 commit comments