0

我试图在 KinecticJS 中获取元素的缩放高度/宽度,但 getHeight()/getWidth() 只返回原始高度和宽度,而不是缩放后的高度和宽度。有我缺少的功能吗?

在此先感谢,马特

4

1 回答 1

0

解决了它:

//Get scale...
var scale = target.getScale().x;
var height = target.getHeight(); var width = target.getWidth();

//Get scaled height by multiplying the scale by the width/height
var scaleWidth = scale*width; var scaleHeight = scale*height;
于 2012-12-06T17:58:33.730 回答