Skip to content
Advertisement

How to set canvas origin to center in fabricjs?

When I draw a circle on fabricjs canvas it always appears on bottom right corner even though I set the coordinates to center. How can I make the circle draw center of the canvas?

JavaScript

Advertisement

Answer

You can set drawing origin of the circle object to center, using originX and originY property.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement