Skip to content

Add a checkered background to transparent artboards and the infinite canvas#4022

Merged
Keavon merged 6 commits intomasterfrom
checkered-transparency
Apr 10, 2026
Merged

Add a checkered background to transparent artboards and the infinite canvas#4022
Keavon merged 6 commits intomasterfrom
checkered-transparency

Conversation

@Keavon
Copy link
Copy Markdown
Member

@Keavon Keavon commented Apr 10, 2026

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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rs has a rendering-stability risk (severity 5/10) because the Vello checkerboard path divides by viewport_zoom without 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.rs and node-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.

@Keavon Keavon changed the title Add a checkered background to artboards and the infinite canvas Add a checkered background to transparent artboards and the infinite canvas Apr 10, 2026
@Keavon Keavon merged commit da45ab2 into master Apr 10, 2026
12 checks passed
@Keavon Keavon deleted the checkered-transparency branch April 10, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checkered background in main viewport

1 participant