Canvas coordinates in Fabric.js have offset

后端 未结 3 2089
长发绾君心
长发绾君心 2020-12-15 01:20

I just started with fabric.js and I have a (probably beginner) error:

I am using fabric with jquery with the following code:

$(document).ready(functi         


        
3条回答
  •  抹茶落季
    2020-12-15 02:06

    I want to comment but lack the reputation to do so. So anyway, here is what happens when I do the following:

    fabric.Object.prototype.originX = "left";
    fabric.Object.prototype.originY = "top";
    

    The shape gets rendered fine but when I select it for resizing or moving, it gets offset to a different location. The best approach seems to be to set the coordinates for every object separately using the set() method.

提交回复
热议问题