Fabric.js ... how to center the canvas
fabricjs converts:
// this DOM structure
<div id="wrapper">
<canvas id="c"></canvas>
</div>
// to this:
<div id="wrapper">
<div class="canvas-container">
<canvas class="upper-canvas"></canvas>
<canvas class="lower-canvas" id="c"></canvas>
</div>
</div>
... see this explanation
Due to the way the js fabric wraps the canvas element, how you hold the canvas horizontally in the center.
here is a question like . here is the script test
+5