Iin KonvaJS, how to batch resize all items in a group porportionally?

144 views Asked by At

In KonvaJS it is possible to rotate all elements in a group like:

(this refers to the group object)

this.rotation('30'); // rotates all elements inside the group by 30°

Now If I try to resize the width/height it won't work.

 // trying to set the group width to 300px and make the grouped items inside increase proportionally.

this.width(300);
1

There are 1 answers

0
Azevedo On

I found it:

this.scale({x: '1.1', y: '1.1'});

In this case 1.1 means 10% larger. It affects all elements in group.