polotno-project / polotno-studio

Free online Design Editor.
https://studio.polotno.dev/
Other
951 stars 198 forks source link

Resize and reposition groups programmatically #32

Open mordechaim opened 1 year ago

mordechaim commented 1 year ago

When I group elements I can easily drag and resize them in the UI, but calling set() on the group with x, y, width, or height has no effect.

Can the UI functionality be exposed to the API?

lavrton commented 1 year ago

At the current moment, groups have no their own position and size. Only final shapes (text, image, svg, line) have them. So if you want to move a group, you need to move every child.

mordechaim commented 1 year ago

Ok for moving around I can simply add the coordinates, but scaling seems challenging.

Any pointers how to do this?

lavrton commented 11 months ago

Hey, sorry for the late replay. So you want to change position/size via some inputs on the page? Or what is your use case?

mordechaim commented 11 months ago

It's not relevant anymore, but my idea was to have a way to add a group of elements to a specific position on the canvas programmatically.