

Lazy Brush
JavaScript library to draw smooth curves and straight lines with your mouse, finger or any pointing device.
Cost / License
- Free
- Open Source
Platforms
- Self-Hosted
- JavaScript
- Typescript

Lazy Brush
Features
- Smooth lines
Lazy Brush information
What is Lazy Brush?
JavaScript library to draw smooth curves and straight lines with your mouse, finger or any pointing device.
This library provides the math required to implement a "lazy brush". It takes a radius and the {x,y} coordinates of a mouse/pointer and calculates the position of the brush.
The brush will only move when the pointer is outside the "lazy area" of the brush. With this technique it's possible to freely draw smooth lines and curves with just a mouse or finger.
How it works
When the position of the pointer is updated, the distance to the brush is calculated. If this distance is larger than the defined radius, the brush will be moved by distance - radius pixels in the direction where the pointer is.
