feat(line): smart-align snap on thickness side-handle drag#72
Merged
Conversation
The thickness handle previously bypassed the snap pipeline entirely, so the band's outer edge could never align to other objects or label edges even when grid-snap was off. Wire it into computeResizeSnap with a single active edge (bottom for horizontal lines, right for vertical), matching how the Transformer-based free resize already snaps. Shift bypasses, diagonals and rotated views skip (band axis not stage-aligned for either case). Reuses othersSnapshotRef and clearSnap with the endpoint-drag pattern so the lifecycle and translation handling stay consistent.
There was a problem hiding this comment.
Code Review
This pull request introduces smart-align snapping for the thickness side-handle of line objects, allowing the line width to snap to other objects on the canvas. The implementation adds a snapThickness function that calculates a bounding box for the line's band and delegates to the existing resize snap logic. Feedback identifies three improvement opportunities: normalizing rotation calculations for better robustness, verifying the alignment of the localBand coordinates with the visual rendering to prevent sub-pixel offsets, and avoiding premature rounding of the thickness value before snapping to maintain precision.
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.