Smart alignment guides, snap system, gap reader, and resize snap#1
Open
Smart alignment guides, snap system, gap reader, and resize snap#1
Conversation
- Screen dragging with edge/center/equal-size snap alignment guides - Live distance ruler measurements during drag along active guides - Option/Alt + hover gap distance reader between selected and hovered frames - Parent inset mode showing 4-side distances when hovering parent container - Fix selection overlay lag during screen drag by tracking selectedNode in measurement effect Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When resizing a frame inside a stack/auto-layout parent, the dragged edge snaps to sibling frame edges with guide lines. Tracks raw (unsnapped) dimensions separately to prevent jitter, queries sibling DOM rects each frame for accurate positions in reflowing layouts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
New files
alignment-guides.ts— pure snap/alignment computation (edges, centers, equal-size multi-guides, distance indicators)alignment-overlay.svelte— SVG overlay for guide lines and distance labelsgap-measurement.ts— gap and inset distance computation between two rectsgap-overlay.svelte— SVG overlay for gap measurement labelsModified files
canvas.svelte— screen drag handling, Alt+hover gap measurement,data-idon screen divseditor-state.svelte.ts— publicfindParent(),selectedNodein measurement effectselection-overlay.svelte— resize snap logic with sibling edge detection and guide SVG renderingTest plan
🤖 Generated with Claude Code