0.0.3 • Published 5 years ago

draw-lock-angle v0.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

draw-lock-angle

A small library to lock angle when drawing on canvas in Javascript

CircleCI Size

Checkout the demo https://ittus.github.io/draw-lock-angle/

How to use

Install

  yarn add draw-lock-angle

Usage

import { calculatePosition } from 'draw-lock-angle'
projection = calculatePosition (newPoint, oldPint, config)

Config

PropTypeDefaultDescription
isSimpleBooleanfalseIf 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
boundaryObject. Format: {minX: Number, minY: number, maxX: number, maxY: number}undefinedBoundary of calculation

Development

yarn install

Compiles and hot-reloads for development

yarn run serve

Compiles and minifies for production

yarn run build

Run your tests

yarn run test

Lints and fixes files

yarn run lint

Support