JSFiddle - React, Tailwind, and code Playground

by Subhasish2015

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.5.0/fabric.min.js"></script>
<b>Click Rectangle to draw rectangle.

If you draw by dragging to right , it works.
However if you drag to left , it will still draw to right.</b>
<canvas id="canvas2" width=500 height=500 style="height:500px;width:500px;"></canvas>
	<img width=500 height=500 alt="" id="scream" src="canvas.png" style="display:none;"/>
	<div style="position: relative; width: 1300px; height:30px; border: 2px solid black; margin-top: 5px">
    <input type="button" id="2" value="rectangle">
</div>
	 <script src="./fabric.min.js"></script>
	 <script src="./jquery.min.js"></script>