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.

35 lines (34 loc) 903 B
import { Cursor } from "../types/Cursor.js"; /** * Represents the cursor style configuration for a canvas, defining how the cursor appears in * different states such as default and pan (dragging) mode. */ export class CanvasCursorStyle { /** * Cursor style in the default state. */ default; /** * Cursor style when panning is active on the canvas. */ panActive; /** * Default style for the canvas cursors. */ static DefaultStyle = { default: Cursor.Default, panActive: Cursor.Grabbing }; /** * Creates a new instance of CanvasCursorStyle. * * @param style - The partial style provided by the user. */ constructor(style = {}) { const styleWithDefaults = { ...CanvasCursorStyle.DefaultStyle, ...style }; Object.assign(this, styleWithDefaults); } }