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.

26 lines (25 loc) 867 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RectangleDefinition = void 0; const ShapeDefinition_js_1 = require("./ShapeDefinition.js"); /** * Class representing a Rectangle definition. */ class RectangleDefinition extends ShapeDefinition_js_1.ShapeDefinition { /** * Creates a new instance of RectangleDefinition. * * @param position - The position of the rectangle (top-left or center). * @param width - The width of the rectangle. * @param height - The height of the rectangle. * @param angle - The angle of the rectangle in degrees. */ constructor(position, width, height, angle) { super(); this.width = width; this.height = height; this.position = position; this.angle = angle; } } exports.RectangleDefinition = RectangleDefinition;