Rotated RND resizing problem
See original GitHub issueQUESTION
I am finding it difficult to resize a RND that is rotated by xdeg around the Z axis. Is resizeHandlerStyles prop a solution? Or is it not supported by the component altogether?
Thanks
I’m using react-rnd 5.0.8
Steps to Reproduce
- Rotate an RND by 90deg
transform: rotateZ(90deg) - Resize using the right handler
Expected behavior
Should increase/decrease the width of the RND along X direction
Actual behavior
Scales the image / does some unexpected resize Handler style also looks wrong
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
react-rnd-rotate - npm Package Health Analysis
A resizable and draggable and rotate component for React For more information about how to use this package see README.
Read more >Resizing Handles on a Rotated Element - javascript
EDIT: I've got drag start, drag move, and drag end callbacks on each handle. My current code simply gets the new point (in...
Read more >Why and How to Implement Random Rotate Data ...
One common data augmentation technique is random rotation. A source image is random rotated clockwise or counterclockwise by some number of ...
Read more >Introducing A New Web Component To Drag, Resize And Rotate
With it you can add drag, resize and rotate features to your applications or websites, regardless of your web framework. Cherry on the...
Read more >react-rnd
My question: is there any way to add css transform of RND component using style ... be) the possibility to rotate the elements...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nandukalidindi The library will not support rotation by it self. As discussed here (https://github.com/bokuweb/re-resizable/pull/129). You must use latest version and implement your logic.
Here is my implementation in ES6. You must know how big the div is. Set the
handleWrapperStyleprop. Feel free to use it. Don’t know If it should be implemented by the library. @bokuweb ?The rotation is not set on the resize div, but in children div (your div). The calculation will just fix the “handlers” to match the children rotation.
Sorry, I haven’t gotten a chance to try out the approach suggested by @pionl which could work for my use case. Now that
handleWrapperStyleis implemented in the library itself, will give it a shot. Thanks @pionl and @bokuweb. Closing this issue for now.