gpt4 book ai didi

javascript - 在Konva JS中,如何按比例批量调整组中所有项目的大小?

转载 作者:行者123 更新时间:2023-12-03 05:22:04 35 4
gpt4 key购买 nike

在 KonvaJS 中,可以旋转组中的所有元素,例如:

(this 指的是组对象)

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

现在,如果我尝试调整宽度/高度的大小,它将不起作用。

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

this.width(300);

最佳答案

我找到了:

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

在本例中,1.1 表示增大 10%。它影响组中的所有元素。

关于javascript - 在Konva JS中,如何按比例批量调整组中所有项目的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41334012/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com