【问题标题】:Kinectic JS - How to get the scaled height of element?Kinetic JS - 如何获取元素的比例高度?
【发布时间】:2012-12-06 16:39:52
【问题描述】:

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

提前致谢, 马特

【问题讨论】:

    标签: javascript jquery kineticjs


    【解决方案1】:

    解决了:

    //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;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-09
      • 1970-01-01
      • 1970-01-01
      • 2014-03-26
      • 2016-04-27
      • 1970-01-01
      相关资源
      最近更新 更多