Conversation
A circle is structurally an ellipse with width=height, but enforcing that constraint manually in the existing ellipse panel is error-prone. Adds a Circle type with a single diameter prop, a commitTransform that clamps to the smaller scale axis (so the resized circle stays inside the user's drag box), and ZPL output that emits ^GE with the diameter on both axes. Locale keys added in all 32 languages via the existing add_locale_key.local.py script. Parser is unchanged: imported ^GE remains an ellipse since ZPL has no separate circle command.
Adds an optional uniformScale flag on ObjectTypeDefinition. When set, the transformer restricts to corner anchors and forceSquareBox clamps the resize bbox to the larger of the two axes while pinning the inferred anchor corner. Visual feedback during drag now matches the uniform commitTransform applied on release; circle is the first consumer. forceSquareBox lives in transformerGeometry next to its sibling helpers and has unit coverage for all four corner anchors.
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'circle' object type, featuring Konva-based rendering, ZPL generation, and comprehensive localization. It also implements a 'uniformScale' mechanism within the transformer to maintain a 1:1 aspect ratio for specific shapes. The review feedback suggests enhancing the properties panel by clamping diameter and thickness inputs to a minimum of 1 to prevent invalid or invisible object states.
Adds src/lib/inputParse.ts with clampMin and parseIntOrUndef. clampMin replaces the bare `Number(e.target.value)` pattern in the shape PropertiesPanels (box, ellipse, circle, line) so an empty or sub-floor input no longer collapses dimensions to 0. parseIntOrUndef moves out of PropertiesPanel.tsx into the shared module since it has the same sanitisation purpose. Other registries keep their unclamped pattern for now; pulling them in is independent and can happen organically as files get touched.
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.
No description provided.