Skip to content Skip to sidebar Skip to footer

Values Of Fabric.js Canvas Coordinates Change When Canvas Is Repositioned

Consider the following code in the body tag:
Now, under the script tag, var

Solution 1:

canvas.calcOffset() 

is what you need..

Whenever you reposition canvas call the above method.

This calculates canvas element offset relative to the document.

This method is also attached as "resize" event handler of window.

Also for an object when changing position/dimension -related properties (left, top, scale, angle, etc.) set does not update position of object's borders/controls.

If you need to update those, call:

setCoords().

Post a Comment for "Values Of Fabric.js Canvas Coordinates Change When Canvas Is Repositioned"