Repository navigation
Snap to center alignment in Arrange Displays - #268
Merged
Merged
Conversation
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.
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.
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.swiftwith 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