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

Add support for rotation. #19

Open
damywise opened this issue Oct 8, 2023 · 7 comments · May be fixed by #24
Open

Add support for rotation. #19

damywise opened this issue Oct 8, 2023 · 7 comments · May be fixed by #24

Comments

@damywise
Copy link

damywise commented Oct 8, 2023

Is your feature request related to a problem? Please describe.
The current version of the hyper-designed/box_transform library does not support rotation, which limits its usefulness for certain UI design tasks, though it may be arbitrary.

Describe the solution you'd like
I would like to see support for rotation added to this package. This would allow for more advanced resizing and manipulation of UI elements.

Describe alternatives you've considered
Made my own hacky and messy but worky solution

Additional context
What I hope everyone can do with only this package:

Screen.Recording.2023-10-08.at.10.57.50-00.00.00.000-00.00.40.183.mp4
@SaadArdati
Copy link
Collaborator

@damywise The difficult part about rotation is that it also needs to work with constraints and clamping, not the rotation itself. With that in mind, I would love to look at your working solution if you have the code somewhere, maybe it can inspire us towards a better solution.

Feel free to make a draft PR if you're really confident, then we can collaborate on it together!

@damywise
Copy link
Author

damywise commented Oct 8, 2023

It's been a while since I've worked on it and some things are broken but here you go.
https://github.com/foamify/editicert
I don't even remember what works and what's broken or how most things work.
Also basically all math-related code are made with the help of AI lol.
Sorry for the messy code lol
If you want to ask about anything you can ask in Discord
or here's also fine

@SaadArdati
Copy link
Collaborator

@damywise This project is very interesting. I would love it if you could try replicating this somewhat in box transform.

As a minimum implementation, we can try visual-rotation only where the rotation does not affect the bounding box. Do you want to give it a shot?

@damywise
Copy link
Author

damywise commented Oct 8, 2023

This project is very interesting

Thanks!

Do you want to give it a shot?

I can't guarantee that I can make time for it, but we'll see.
I probably have to refactor the whole thing.

Also, I just read through my code and remembered that I actually don't use a rectangle lol.
I used a triangle with one point as the base offset and generate the resulting rectangle from that because that's the easiest approach I can understand.

@SpirikleOfficial
Copy link

Hi, I required this package for placing an image on top of image (and dragging, resizing etc.), however, the no rotation thing drastically limits this package's real life use. Please try to overcome this limitation. Hoping to see this feature soon.

@SaadArdati
Copy link
Collaborator

Hi, I required this package for placing an image on top of image (and dragging, resizing etc.), however, the no rotation thing drastically limits this package's real life use. Please try to overcome this limitation. Hoping to see this feature soon.

Hey @SpirikleOfficial, it's unfortunately very difficult as no other software we know can do rotation with clamping and constraints. If you know someone that may help us out, let us know. Until then, we cannot give you a timeline on this.

@mr-stan-dev
Copy link

@damywise This project is very interesting. I would love it if you could try replicating this somewhat in box transform.

As a minimum implementation, we can try visual-rotation only where the rotation does not affect the bounding box. Do you want to give it a shot?

That would be great if we could have at least this implementation in the package. Thanks.

@SaadArdati SaadArdati linked a pull request Jun 4, 2024 that will close this issue
@SaadArdati SaadArdati linked a pull request Jun 4, 2024 that will close this issue
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 a pull request may close this issue.

4 participants