Add a checkered background to transparent artboards and the infinite canvas#4022
Merged
Add a checkered background to transparent artboards and the infinite canvas#4022
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the explicit "Transparent Background" option from the export dialog, implementing automatic transparency handling and a checkerboard pattern for transparent areas in the viewport. It also defaults artboard clipping to true and adds a white background layer for new documents without artboards. Review feedback identifies a bug in the JPG blending logic concerning premultiplied alpha and a potential compilation error in the checkerboard generation code.
Contributor
There was a problem hiding this comment.
2 issues found across 21 files
Confidence score: 3/5
- Moderate merge risk: there is a concrete behavior bug in
editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs(severity 6/10, high confidence) where finite zero-dimension documents can be misrouted into infinite-canvas background initialization. node-graph/nodes/gstd/src/render_node.rshas a rendering-stability risk (severity 5/10) because the Vello checkerboard path divides byviewport_zoomwithout a positive-value guard, so zero zoom can produce invalid Affine scale values (infinite/NaN).- These are specific, user-facing edge-case regressions rather than broad architectural problems, so this looks fixable but carries some real runtime risk until patched.
- Pay close attention to
editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rsandnode-graph/nodes/gstd/src/render_node.rs- document initialization routing and zero-zoom rendering guards need validation.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs">
<violation number="1" location="editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs:34">
P2: Finite zero-dimension documents are incorrectly routed through the infinite-canvas background initialization branch.</violation>
</file>
<file name="node-graph/nodes/gstd/src/render_node.rs">
<violation number="1" location="node-graph/nodes/gstd/src/render_node.rs:211">
P2: Vello checkerboard path divides by viewport_zoom without ensuring it’s positive, unlike the SVG branch. A zero zoom would yield an infinite/NaN Affine scale and can corrupt rendering; add the same `viewport_zoom > 0.` guard here.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
editor/src/messages/dialog/new_document_dialog/new_document_dialog_message_handler.rs
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Artboards with a transparent background color, and the infinite canvas, now display a checkerboard pattern to indicate where transparency is present. Now, instead of displaying a white background and relying on the Export dialog's Transparency checkbox to disable that background just during the export, we support a proper transparent background for both artboards and the infinite canvas. That checkbox has been removed to simplify the export process so it matches expectations of what is shown. Creating a new document with an infinite canvas now includes a locked white solid color layer labeled "Background", adding the capability of altering that background color when it previously displayed always as white.
Closes #4021