box_transform icon indicating copy to clipboard operation
box_transform copied to clipboard

Add support for rotation.

Open damywise opened this issue 2 years ago • 7 comments

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:

https://github.com/hyper-designed/box_transform/assets/25608913/a53ab372-b67a-4078-9fd5-c5f84204f751

damywise avatar Oct 08 '23 04:10 damywise

@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!

SaadArdati avatar Oct 08 '23 07:10 SaadArdati

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

damywise avatar Oct 08 '23 11:10 damywise

@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?

SaadArdati avatar Oct 08 '23 12:10 SaadArdati

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.

damywise avatar Oct 08 '23 12:10 damywise

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.

SpirikleOfficial avatar Oct 17 '23 12:10 SpirikleOfficial

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.

SaadArdati avatar Oct 17 '23 14:10 SaadArdati

@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.

mr-stan-dev avatar Jan 05 '24 15:01 mr-stan-dev