Tag:Draw on
-
Day 23/100 React Fabric. JS to realize the line shape that can be dragged and rotated
1. Demand Draw a line between two points on the canvas and mark it on the canvas. 2. Realize var line = new fabric.Line([10, 20, 115, 110], { strokeWidth: 2, stroke: ‘red’, originX: ‘center’, originY: ‘center’ }); canvas.add(line); The effects are as follows: 3. Complete code /* * @Author: ArdenZhao * @Date: 2021-12-07 11:35:45 * […]