Conversation
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.
There was a problem hiding this comment.
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.
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
added a commit
that referenced
this pull request
Apr 25, 2026
Refactor barcode positioning and sizing
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.
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
buildBwipOptionsfunction by assigning options to a variable before returning.