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

[Grida Canvas] Rotation handle origin sensitive rotation gesture #221

Open
softmarshmallow opened this issue Jan 6, 2025 · 2 comments
Open
Assignees
Labels
bug Something isn't working canvas good first issue Good for newcomers

Comments

@softmarshmallow
Copy link
Member

Summary

The rotation handle works, but its behaviour is somewhat unexpected, resulting poor control & ux.

The current rotation gesture does not care about its rotation handle origin, simply takes the mouse movement as a angle,
Which instead, it should calculate the rotation based on the handle origin.

Details & Examples

We have 4 rotation control points per each node overlay.

  • nw (top left)
  • ne (top right)
  • se (bottom right)
  • sw (bottom left)

Let's say we have a 0, 0, 100, 100 rectangle, (100x100 rectangle at 0,0)
The each control points would be placed at

  • nw 0, 0
  • ne 100, 0
  • se 100, 100
  • sw 0, 100

The rotation will apply based on the center point, (50, 50) and the amount of new angle to be applied shall be calculated based on the mouse movement and the rotation handle origin.

Current behaviour

Screen.Recording.2025-01-07.at.3.50.09.AM.mov

Expected

Screen.Recording.2025-01-07.at.3.51.51.AM.mov

Bonus

While we do this, we also need to adjust the svg cursor rotation, to make the rotation handle cursor rotate as well as we rotate.

@softmarshmallow softmarshmallow added bug Something isn't working good first issue Good for newcomers canvas labels Jan 6, 2025
@ramu-narasinga
Copy link

Can I work on this please? Thanks.

@softmarshmallow
Copy link
Member Author

@ramu-narasinga Assigned! Go shoot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working canvas good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants