A small library to lock angle when drawing on canvas in Javascript
Checkout the demo https://ittus.github.io/draw-lock-angle/
yarn add draw-lock-angle
import { calculatePosition } from 'draw-lock-angle'
projection = calculatePosition (newPoint, oldPint, config)
Prop | Type | Default | Description |
---|---|---|---|
isSimple | Boolean | false | If isSimple is true, only calculate projection on horizontal line and vertical line. If isSimple is false, calculate the nearest projection on 0, 45, 90, 135-degree line |
boundary | Object. Format: {minX: Number, minY: number, maxX: number, maxY: number} | undefined | Boundary of calculation |
yarn install
yarn run serve
yarn run build
yarn run test
yarn run lint