Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix freehand-drawn sliders with distance snap #25539

Merged
merged 2 commits into from Nov 27, 2023

Conversation

default0
Copy link
Contributor

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:

  • We can insert the linear point (0, 0) into the bspline builder to trace a path from the hitobjects snapped position to the current cursor position, resulting in this behaviour:
2023-11-22.09-51-54.mkv.mp4
  • Or we can reposition the hit object so it ignores distance snap and instead starts at the current cursors location
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.

@peppy
Copy link
Sponsor Member

peppy commented Nov 22, 2023

I think I prefer the case that respects distance snap personally..

This will cause freehand drawing to respect distance snap, instead
changing the drawn path to start from the sliders start position
and "snap" in a linear fashion to the cursor position from the
position indicated by distance snap
@default0
Copy link
Contributor Author

Updated :-)

@Tom94
Copy link
Contributor

Tom94 commented Nov 22, 2023

I've got a third proposal: what about translating the generated path by the offset to the snapped position on drag start? That way, the user's cursor wouldn't coincide with the endpoint of the path anymore, but there wouldn't be a weird linear segment at the start and distance snap would still be respected. EDIT: might have to hide & freeze the actual mouse cursor while drawing is ongoing to make this proposal ergonomic

@peppy
Copy link
Sponsor Member

peppy commented Nov 22, 2023

Hiding the mouse sounds very weird..

@bdach bdach added ruleset/osu! area:editor next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! labels Nov 24, 2023
@bdach
Copy link
Collaborator

bdach commented Nov 27, 2023

I'm just going to get this in, in its current state, to fix the clearly broken behaviour for next release. We can iterate on this going forward based on user feedback.

@bdach bdach merged commit 63481e8 into ppy:master Nov 27, 2023
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editor next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! ruleset/osu! size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants