Repository navigation
Tab cycles through every object snap under the cursor, not one per mode (gaps U4) - #1408
Open
marcoarnulfo wants to merge 1 commit into
Open
marcoarnulfo wants to merge 1 commit into
marcoarnulfo wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Tab now cycles through every object snap under the cursor, not just the closest one of each mode.
In AutoCAD, pressing Tab at a point prompt steps through all the snap points in the aperture: with two line ends a hair apart, Tab reaches both, and after the last one it comes back to the first. Until now
snap_candidatesoffered the closest snap of each running mode, so the second endpoint (or a second intersection, a second midpoint) was out of reach. This addssnap::points_near, which returns every gathered snap point within the aperture (it reuses the same gather/intersection/PER-TAN passosnapruns, by lettingfinishadd to the candidate list instead of consuming it), andsnap_candidatesmerges those with the per-mode hits, nearest first, without repeats. The UI side is unchanged: the cycle still starts from the snap the marker shows, wraps around, and starts over once the cursor leaves the aperture. Nearest and deferred TAN/PER stay one candidate each (they have no fixed points), and model geometry seen through a layout viewport still offers one snap per mode; happy to extend that to every point too if you want it in this PR.Two things I noticed and left alone, both already there before this change: leaving the canvas over a palette and coming back doesn't reset the cycle (a one-line change in
canvas.rs, which I kept out because of #1061), and the quick-click path from #815 recomputes the snap withoutoverride_cursor, so it ignores a candidate picked with Tab. Happy to follow up on either.Validation:
tab_snap_cycling::tab_reaches_both_close_endpoints,tab_goes_from_the_nearest_out_and_back_to_the_first,a_click_places_the_candidate_tab_chose: fail on main (Tab stays on 10,0, the only candidate), pass heretab_snap_cycling::moving_the_cursor_away_starts_the_cycle_over,snap_overrides::tab_cycling_offers_every_endpoint_in_the_aperture_nearest_first(main returns 1 candidate of 3)cargo test -p cadcraft-engine --test snap_overrides,cargo test -p cadcraft-ui-egui --test tab_snap_cycling --test measure_distance_snapping --test context_menucargo clippy -p cadcraft-engine -p cadcraft-ui-egui --all-targets -- -D warnings,cargo fmt --all -- --check