Kinetic JS - 如何获得元素的缩放高度?

时间:2012-12-06 16:39:52

标签: javascript jquery kineticjs

我正在尝试在KinecticJS中获取元素的缩放高度/宽度,但getHeight()/ getWidth()仅返回原始高度和宽度,而不是缩放的高度和宽度。有没有我失踪的功能?

提前致谢, 马特

1 个答案:

答案 0 :(得分: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;