Repository navigation
fix(input): clamp selection translation against visible canvas rect (#422) - #423
Merged
devmobasa merged 1 commit intoOct 25, 2026
Merged
Conversation
…n panned boards Issue devmobasa#422: Clamping against screen dimensions on panned or zoomed boards uses mismatched units (canvas bounds vs screen dimensions), causing selections to jump offscreen on the first drag motion or arrow-key nudge. Clamp against the visible canvas rect instead.
Contributor
Author
|
Tested live on my local machine. |
Owner
|
Thanks @gsmith-alvarez |
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.
Clamping selection translation against screen dimensions on panned or zoomed boards causes selections to jump offscreen on the first drag motion or arrow-key nudge (canvas coordinates were being clamped against screen pixel limits).
This clamps the selection bounds against
visible_canvas_rectinstead, keeping shape translation constrained to the visible canvas area across board pans and zoom levels.Validation:
src/input/state/tests/transform.rs:moving_a_selection_on_a_panned_board_follows_the_pointermoving_a_selection_at_zoom_keeps_it_inside_the_visible_canvascargo test --lib moving_a_selection(2 passed, 0 failed).cargo fmt --checkclean.git diff --checkclean.Closes #422.
(Note: The root-cause diagnosis and patch implementation were generated with AI assistance.)