@avolutions/canvas-painter
Version:
CanvasPainter.js is a simple yet powerful JavaScript library for drawing basic shapes (rectangles, circles, etc.) on HTML5 Canvas with ease. Perfect for creating 2D graphics in your web projects.
33 lines (32 loc) • 712 B
JavaScript
/**
* Options for configuring the zoom behavior of a canvas.
*/
export class ZoomOptions {
/**
* The step value for zoom increments.
*/
step;
/**
* Whether zooming with the mouse wheel is enabled.
*/
useWheel;
/**
* Default zoom options.
*/
static DefaultOptions = {
step: 0.1,
useWheel: true
};
/**
* Creates a new instance of ZoomOptions.
*
* @param options - The partial options provided by the user.
*/
constructor(options = {}) {
const optionsWithDefaults = {
...ZoomOptions.DefaultOptions,
...options
};
Object.assign(this, optionsWithDefaults);
}
}