Commit 872a2b6
fix(renderer): align font metrics to device pixel boundaries to prevent seams
When devicePixelRatio is non-integer (e.g. 1.25/1.5/1.75 from browser zoom),
rounding cell width/height to the nearest CSS pixel produces fractional physical
pixel coordinates at cell edges. The canvas rasterizer antialiases
clearRect/fillRect at those sub-pixel boundaries, and with alpha:true the
resulting partially-transparent edge pixels composite against the page
background and appear as thin black seams between rows and columns.
Fix by rounding up to the nearest *device* pixel instead:
Math.ceil(value * dpr) / dpr
This guarantees cell boundaries always fall on exact physical pixel boundaries
regardless of zoom level or monitor DPR.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6a1a50d commit 872a2b6
1 file changed
+14
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
| |||
0 commit comments