Skip to content

Snap to center alignment in Arrange Displays - #268

Merged
didriksg merged 1 commit into
mainfrom
feature/center-snap
Nov 11, 2026
Merged

didriksg merged 1 commit into
mainfrom
feature/center-snap

Conversation

@didriksg

Copy link
Copy Markdown
Owner

When you drag a display against another one and the centers come within a few points, it slides along the shared edge so the centers line up, and a thin line through both centers shows while it holds. Stacked displays line up horizontally, side by side vertically. Edge snapping works as before; whichever of the edges and the center is nearest wins.

The center leeway is 4 canvas points against 10 for edges, because the thumbnails are small: beside a 2560x1440 display, the top, center and bottom spots of a 1512x982 one are only about 11 points apart, so 10 for each would leave nowhere else to drop it. An alignment that would slide the display into a third one is skipped. The snap logic moved to Models/ArrangementSnap.swift with tests, one of them the three-display stack from the issue.

Tested by hand with a MacBook under a 27" display and beside it: after the drop, the centers matched to the point.

Fixes #259

A dragged display that touches another one now slides along the shared edge to line up its center with the other display's when the centers come within 4 canvas points, and a thin accent line through both centers shows while it holds. Stacked displays line up their horizontal centers, side by side their vertical centers. Edge alignment keeps its 10 points; the nearest of the edges and the center wins. Center gets the smaller leeway because the thumbnails are small: next to a 2560x1440 display the top, center and bottom positions of a 1512x982 one are about 11 canvas points apart, so 10 for all three would leave no free position on the side. An alignment that would slide the display into a third one is now dropped. The snap moved to Models/ArrangementSnap.swift with tests, including the three-display stack from #259.
@didriksg
didriksg merged commit 5039b06 into main Nov 11, 2026
2 checks passed
@didriksg
didriksg deleted the feature/center-snap branch November 11, 2026 23:23
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.

Snap to center alignment when dragging displays in the arrangement canvas (similar to display-align)

1 participant