Commit 131618f
committed
fix(admin): KeyViz heatmap honours devicePixelRatio
Phase 2-B follow-up to PR #680. Claude bot's round-1 review flagged
that the canvas buffer was sized at CSS-pixel dimensions, leaving
every cell edge blurry on 2x displays. Scale the buffer to physical
pixels via window.devicePixelRatio, keep the CSS style at logical
pixels, and reset the transform with setTransform on every render
so repeated useEffect runs do not stack scales.
The DPR is clamped at 4 so a browser reporting an absurd ratio
(e.g. zoom-aware DPR > 8) cannot balloon the canvas buffer beyond
the rendering budget; at the maximum matrix size 4x DPR is already
16384 x 16384 px.1 parent df5ea5e commit 131618f
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
116 | 124 | | |
117 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
| |||
0 commit comments