Commit 2acfde1
Skip canvas buffer realloc during splitter drag (#105)
Assigning canvas.width/height reallocates the WebGL drawing buffer; on
Windows Chrome (ANGLE -> D3D11) a fresh buffer is magenta until drawn.
During a splitter drag the holder resizes every frame while the game
step may be skipped or lag the resize, so the raw magenta buffer shows
through for the whole drag.
Guard the per-frame buffer sync in tickJS on !_uiDragging: the last-good
buffer stretches via CSS (#theCanvas is 100% of the holder) during the
drag, and the first tick after drag-end sees the size mismatch and
reallocates once, snapping crisp. Also removes per-frame realloc +
OnCanvasResized churn during a drag. Both splitter handlers set
_uiDragging, so one guard covers both.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 988edeb commit 2acfde1
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
133 | 143 | | |
134 | 144 | | |
135 | | - | |
| 145 | + | |
136 | 146 | | |
137 | 147 | | |
138 | 148 | | |
| |||
0 commit comments