Skip to content

feat: Implement snap-to-grid and object snapping for resize#5

Merged
u8array merged 2 commits into
mainfrom
feature/resize-smart-align
May 4, 2026
Merged

feat: Implement snap-to-grid and object snapping for resize#5
u8array merged 2 commits into
mainfrom
feature/resize-smart-align

Conversation

@u8array
Copy link
Copy Markdown
Owner

@u8array u8array commented May 4, 2026

Introduces snap-to-grid functionality for resizing labels, mirroring the behavior of drag-and-drop snapping. Also enhances object snapping during resize operations, ensuring visual alignment with other elements on the canvas. This includes logic for deriving active edges during resize and computing snap points based on proximity to other objects and the label boundary.

Introduces snap-to-grid functionality for resizing labels, mirroring the
behavior of drag-and-drop snapping. Also enhances object snapping during
resize operations, ensuring visual alignment with other elements on the
canvas. This includes logic for deriving active edges during resize and
computing snap points based on proximity to other objects and the label
boundary.
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 introduces object-snapping for element resizing, allowing objects to align with other canvas elements and label boundaries during transformation. The implementation includes a refactor of the snapping logic into reusable helpers, the addition of edge-tracking to determine active resize boundaries, and new unit tests. Feedback suggests replacing hardcoded padding values with constants and considering the extension of snapping support to restricted barcode types.

Comment thread src/lib/snapGuides.ts Outdated
Comment thread src/components/Canvas/hooks/useKonvaTransformer.ts
@u8array u8array merged commit 61749e3 into main May 4, 2026
2 checks passed
@u8array u8array deleted the feature/resize-smart-align branch May 4, 2026 22:11
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