Repository navigation
Conversation
devmobasa
added a commit
to gsmith-alvarez/wayscriber
that referenced
this pull request
Oct 25, 2026
Keep the press as the drag anchor until the pointer leaves the click radius, so the first drag motion is not lost. After that the anchor follows the pointer on every motion, including blocked ones, so reversing at an edge moves the selection at once. Apply coordinate limits on every board. Pannable boards still move freely, but each translated coordinate and the painted bounds now stay in the i32 range. Before, a nudge near i32::MAX wrapped in release builds: the line jumped to span the whole coordinate range and was saved that way. Debug builds panicked instead. On a fixed canvas (the transparent overlay, or a board with panning disabled), a selection that already crosses an edge, or lies outside the canvas, can no longer move further out, and it is never pulled back. Before, any nudge snapped it inside, up to thousands of pixels. Align the move-to-edge actions with the visible canvas, including pan and zoom, instead of the screen origin. A target further away than i32::MAX is reached in several steps that record one undo entry. Combine selection bounds in i64. Shape bounds are clamped to the i32 range, so a shape at the coordinate limit is measured on a copy moved toward the origin; the limits and edge actions then see its full stroke padding. A selection whose painted bounds end past i32::MAX gets no selection Rect, because handle hit-testing and other selection code compute x + width in i32. Its chrome then marks full damage, so the halos of its other members are still repainted. The Properties panel uses the same bounds, the text resize handle is omitted when it would end past i32::MAX, and handle hit-testing compares pointer distances in i64. Test changes: - nudge_selection_clamps_right_and_bottom_edges starts at (87, 87). At (90, 90) the stroke padding already crossed the canvas edge, and the test passed only because the old clamp pulled the shape back. - moving_a_selection_on_transparent_board_clamps_to_screen checks the exact landing edge. It also passed when nothing moved. The coordinate guard and the view-relative edge targets are adapted from devmobasa#424.
Owner
Author
|
Closing in favor of #425 |
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.
Selection movement used screen bounds to clamp canvas coordinates, which could send strokes off-screen after panning or zooming.
Use the visible canvas bounds for dragging, nudging, and edge shortcuts.
Fixes #422