Fix freehand-drawn sliders with distance snap #25539
Merged
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.
Trying to freehand draw a slider when distance snap is active causes the control points to be offset from the slider curve.
The following video demonstrates the current behaviour on master:
2023-11-22.09-52-22.mkv.mp4
There are two possible ways to fix it:
2023-11-22.09-51-54.mkv.mp4
2023-11-22.09-54-08.mkv.mp4
Given that freehand drawing in combination with snap feels strange, another option would be to simply disable the option to freehand draw (ie returning false from OnDragStart) if the hitobjects position is sufficiently far away from the cursor position, however, I fear this might be unintuitive to users.
This PR implements repositioning of the slider to the cursors current location when freehand drawing starts, because to me this seems like the most intuitive approach.