Fix sprocket preview canvas switching#102
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c17366b560
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try { | ||
| const source = getWebglSourceImageData(); | ||
| if (!source) return false; | ||
| adjustCanvasDisplay(source.width, source.height); |
There was a problem hiding this comment.
Reset the backing canvas when returning to WebGL
When sprocket preview is turned off in Step 3, updatePreview() now takes the WebGL path, and this line only restores the CSS display size. The hidden 2D canvas dimensions remain set to the sprocket-framed size from renderFastSprocketPreview/setMainCanvasDimensions, so any later code that uses canvas.width/canvas.height still sees the framed aspect; for example the window resize handler calls adjustCanvasDisplay(canvas.width, canvas.height), which re-applies the sprocket aspect after a resize. Reset the backing canvas dimensions to the non-sprocket source size when switching back to WebGL.
Useful? React with 👍 / 👎.
Summary
Verification