Skip to content

Refactor barcode positioning and sizing#2

Merged
u8array merged 3 commits intomainfrom
feat/cutom-font
Apr 21, 2026
Merged

Refactor barcode positioning and sizing#2
u8array merged 3 commits intomainfrom
feat/cutom-font

Conversation

@u8array
Copy link
Copy Markdown
Owner

@u8array u8array commented Apr 21, 2026

This commit refactors the positioning and sizing logic for barcode objects. It introduces more accurate calculations for 2D barcodes and corrects baseline corrections for various barcode types, including specific adjustments for QR codes. Additionally, it clarifies the buildBwipOptions function by assigning options to a variable before returning.

This commit refactors the positioning and sizing logic for barcode
objects. It introduces more accurate calculations for 2D barcodes and
corrects baseline corrections for various barcode types, including
specific adjustments for QR codes. Additionally, it clarifies the
`buildBwipOptions` function by assigning options to a variable before
returning.
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 refactors barcode rendering and positioning logic to better align with Zebra firmware behavior. Key changes include updating getDisplaySize to handle implicit scaling for 2D barcodes and implementing specific baseline corrections for QR codes, including offsets for both FT and FO positioning types. Additionally, the handleDragEnd functions in both BarcodeObject and KonvaObject were updated to correctly reverse these display offsets when updating object coordinates. Feedback highlights dead code for datamatrix in KonvaObject.tsx, a potential misalignment for shapes due to missing inverse render logic, and missing fallback corrections for 2D barcodes when the canvas is unavailable.

Comment thread src/components/Canvas/KonvaObject.tsx Outdated
Comment thread src/components/Canvas/BarcodeObject.tsx
u8array added 2 commits April 22, 2026 00:36
Introduce constants for fixed scaling and offsets related to bwip-js and
Zebra firmware artifacts. This clarifies the calculations for 2D barcode
sizes and vertical positioning, improving maintainability and
readability.
@u8array u8array merged commit 9fe4119 into main Apr 21, 2026
2 checks passed
u8array added a commit that referenced this pull request Apr 25, 2026
Refactor barcode positioning and sizing
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