Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在 KinecticJS 中获取元素的缩放高度/宽度,但 getHeight()/getWidth() 只返回原始高度和宽度,而不是缩放后的高度和宽度。有我缺少的功能吗?
在此先感谢,马特
解决了它:
//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;