moveable
moveable copied to clipboard
Behavior of the interaction between resizable and scalable elements.
Environments Framework name: React Framework version: ^18.2.0 Moveable Component version: ^0.54.2 Testable Address(optional):
Description I have multiple targets, where some are scalable, and others are resizable. I noticed that when selecting them and scaling/resizing them, the event that is called is the onResizeGroup, which makes my scalable elements unable to be mirrored.
What I mean is that I want to keep the dimensions of my resizable elements but be able to negatively drag and reposition them, similar to how text elements work in Google Slides.
https://github.com/daybrush/moveable/assets/11366193/d189bbad-9e41-412f-bdca-b0671dc69ac9
Is there any way to achieve this behavior? I've tried different approaches, but I can't solve it.
@JGuardiola95
Would the method you mentioned be as follows?
resizable={{
12 edge: ["e", "w"],
13 renderDirections: ["e", "w"],
14 }}
15 scalable={{
16 edge: [],
17 renderDirections: ["nw", "ne", "se", "sw"],
18 }}
https://daybrush.com/moveable/storybook/?path=/story/advacned-resizable--advanced-resizable-edge-control
Not quite, sorry for any confusion. I hope this explanation will be clearer.
I have two elements: one is scalable (the figure), and the other is resizable (the text element). When both are selected, I'd like to be able to resize the grouped target in a negative direction, maintaining the scalable behavior for the figure to achieve a 'mirror' effect, and simultaneously, I want the text element to be repositioned while keeping its scale at 1,1.
Here is my current behavior:
https://github.com/daybrush/moveable/assets/11366193/a5c4a0cb-6171-493f-bacb-fe854cd1a065
This is exactly what I'm looking for too @daybrush, the basic idea is permitting the two interactions to run on the same user movement, I will decide on each event which targets should apply which event values.
Same here :)
@daybrush I need that feature too.