-
How do make a div that by the end of it I can drag and rotate it? I will paste a link of what I have achieved so far and technically it does the thing but it is super clunky and doesn't work very well... am I doing something wrong? Sandbox or Video Checklist:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
I'm sorry to say but you're using this lib the wrong way 😅 In this case you should only use the drag gesture. The move gesture should only be used when hovering an element. Here is a sandbox where I'm giving away some tricks on how to handle what I guess you want to do (use the yellow shapes): I've had a look at your But you can also have a look at the (if you want to test your original component you should probably comment out mine). |
Beta Was this translation helpful? Give feedback.
I'm sorry to say but you're using this lib the wrong way 😅 In this case you should only use the drag gesture. The move gesture should only be used when hovering an element.
Here is a sandbox where I'm giving away some tricks on how to handle what I guess you want to do (use the yellow shapes):
https://codesandbox.io/s/suspicious-heisenberg-04e8v
I've had a look at your
Ruler
file and fixed it a bit to allow for resizing from the red handle.But you can also have a look at the
Alt
(for alternative solution) file that uses svg to avoid trigonometry calculations. You should rather look at the logic rather than the actual implementation if you need to continue using divs.(if you want to test…