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

Rotary-like control for angles #981

Merged
merged 29 commits into from
Jan 2, 2024
Merged

Rotary-like control for angles #981

merged 29 commits into from
Jan 2, 2024

Conversation

fatih-erikli
Copy link
Collaborator

Fixes #919.

@justvanrossum
Copy link
Collaborator

Please rebase this.

Copy link
Collaborator

@justvanrossum justvanrossum left a comment

Choose a reason for hiding this comment

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

  • When setting the angle numerically to (say) -50, the thumb get shown rotated counter-clockwise, but when dragging the thumb, the value changes in the opposite direction
  • Dragging the thumb is often jumpy
  • Dragging to the right rotates clockwise, and draging up rotates counter-clockwise. I think up should also rotate clockwise.

@fatih-erikli
Copy link
Collaborator Author

When setting the angle numerically to (say) -50, the thumb get shown rotated counter-clockwise, but when dragging the thumb, the value changes in the opposite direction

This is fixed. The rotation of glyph on the canvas is applied counterclockwise. There is conversion to the opposite side happening when dragging the thumb.

@fatih-erikli
Copy link
Collaborator Author

Maybe I delete the conversion and keep it as it is? The rotation will be applied to the opposite side when dragging the thumb, is that ok? @justvanrossum.

@justvanrossum
Copy link
Collaborator

Maybe I delete the conversion and keep it as it is? The rotation will be applied to the opposite side when dragging the thumb, is that ok?

You mean rotate the rotary control clockwise while the component rotates counter-clockwise? No, they should match, that's the whole point.

Btw. please remove that demo panel, and just test with it with a selected component.

The movement is still very jumpy:

RotationJumpy.mov

@fatih-erikli
Copy link
Collaborator Author

Can you test the jumpy behavior with the latest commit?

@fatih-erikli
Copy link
Collaborator Author

Hmm no this is a different kind of jumpy behavior. Video has just been loaded.

@fatih-erikli
Copy link
Collaborator Author

Hmm, it looks like it's fixed with the latest commit.

@justvanrossum
Copy link
Collaborator

It still jumps if you move across the NW - SE axis:

image

@fatih-erikli
Copy link
Collaborator Author

fatih-erikli commented Dec 25, 2023

This is tricky. I tried to fix that by caching the rotation axis, but it expects the drag to be in same direction with when the movement started until the mouse up.

@justvanrossum
Copy link
Collaborator

Can you make the rotary control as big as possible without affecting the item spacing? It is currently smaller than the numeric input. Can it be the same size?

@fatih-erikli
Copy link
Collaborator Author

Maximum height without affecting the item spacing is the current one. There was a margin, I deleted it, they should seem in same height now.

@justvanrossum justvanrossum merged commit cdc8de5 into main Jan 2, 2024
3 checks passed
@justvanrossum justvanrossum deleted the issue-919 branch January 2, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need a rotary control for angles
2 participants