事件缩放不会更新组内部对象的坐标 - Fabric js

时间:2018-02-11 03:50:52

标签: javascript fabricjs

我在一个组中有6个对象,但在缩放时我不更新当前坐标

我尝试使用setCoords(),但它不起作用。

我需要单独left,top,getScaledWidth(),getScaledHeight()。帮我!请

     canvas.on('object:scaling', function (e) {
         var obj = e.target;
         //console.log(obj.id);

         if (obj.id === "GroupObject") {
         obj.setCoords();

         console.log(obj.item(1).left);
         console.log(obj.item(1).top);
         console.log(obj.item(1).getScaledHeight());
         console.log(obj.item(1).getScaledWidth());
         }

0 个答案:

没有答案