Skip to content

fix(parser): render ^GFA zero-bits as transparent, not opaque white#82

Merged
u8array merged 1 commit into
mainfrom
fix/gfa-opacity
May 21, 2026
Merged

fix(parser): render ^GFA zero-bits as transparent, not opaque white#82
u8array merged 1 commit into
mainfrom
fix/gfa-opacity

Conversation

@u8array
Copy link
Copy Markdown
Owner

@u8array u8array commented May 21, 2026

No description provided.

Copy link
Copy Markdown

@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 updates the ZPL parser's handling of the ^GF command to ensure that 0-bits are rendered as transparent instead of opaque white, correctly reflecting ZPL behavior. Review feedback suggests translating the newly added German comments into English for consistency and optimizing the pixel processing loop by removing redundant RGB assignments, as the ImageData buffer is already initialized to zero.

Comment thread src/lib/zplParser.ts Outdated
Comment thread src/lib/zplParser.ts Outdated
0-bits used to be rendered as rgba(255,255,255,255) and obscured
underlying objects. ZPL defines 0-bits as not-printed; in the canvas
preview that maps to transparent so layered fields stay visible.

createImageData starts zero-filled (rgba(0,0,0,0)), which already is
the 0-bit case — only the 1-bit pixels need an alpha write.
@u8array u8array force-pushed the fix/gfa-opacity branch from 2240c23 to a4c159c Compare May 21, 2026 15:41
@u8array u8array merged commit 81d0c5e into main May 21, 2026
1 check passed
@u8array u8array deleted the fix/gfa-opacity branch May 21, 2026 15:41
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.

1 participant