UNPKG

@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) 785 B
import { ShapeOptions } from "./ShapeOptions.js"; /** * Options for configuring the behavior of a line shape. */ export class LineOptions { /** * Determines if the shape should be visible or not. */ visible; /** * Determines if the shape can be dragged by mouse. */ draggable; /** * Default options for the line. */ static DefaultOptions = { ...ShapeOptions.DefaultOptions, }; /** * Creates a new instance of LineOptions. * * @param options - The partial options provided by the user. */ constructor(options = {}) { const optionsWithDefaults = { ...LineOptions.DefaultOptions, ...options }; Object.assign(this, optionsWithDefaults); } }