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

Adjust menu cursor rotation to use a floating centre-point #18841

Merged
merged 2 commits into from Jun 27, 2022

Conversation

peppy
Copy link
Sponsor Member

@peppy peppy commented Jun 25, 2022

Been bugging me for a while. Adjusted snappiness of animations and fixed centre point being stuck at original mouse down location.

var position = e.MousePosition;
float distance = Vector2Extensions.Distance(position, positionMouseDown);

// don't start rotating until we're moved a minimum distance away from the mouse down location,
// else it can have an annoying effect.
if (dragRotationState == DragRotationState.DragStarted && distance > 30)
if (dragRotationState == DragRotationState.DragStarted && distance > 80)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the new distance threshold is a bit aggressive. It allows the cursor to not rotate when moving/spinning in small distances, but is also causing the rotation to no longer occur when dragging near elements around:

CleanShot.2022-06-25.at.14.21.30.mp4

I think going with 50 is sort of a middle-ground solution (along with updating the mouse down position interpolating logic to something like 30-40), but that depends on whether the rotation is meant to be used for such scenarios.

Could instead add a special case for dragged drawables that would switch the cursor to "rotation" mode regardless of distance.

Suggested change
if (dragRotationState == DragRotationState.DragStarted && distance > 80)
if (dragRotationState == DragRotationState.DragStarted && distance > 50)

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally wanted it to invoke less. Will wait for more feedback.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it feels better this way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is pretty old at this point but I went to make a discussion about this exact change thinking it was a bug and found this PR. I really enjoyed dragging the cursor in circles while I was deciding what map to play, doing it absentmindedly, or for the fun of it. It kinda blows I have to intentionally shake the mouse around a bunch to make it happen now. Can this be undone or just happen when dragging something on a list?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't take much effort to enter this mode. You don't need to shake or anything. It's just velocity based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants