@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.
31 lines (30 loc) • 898 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RectangleStyle = void 0;
const Cursor_js_1 = require("../types/Cursor.js");
const ShapeStyle_js_1 = require("./ShapeStyle.js");
/**
* Represents the style options for a rectangle.
*/
class RectangleStyle extends ShapeStyle_js_1.ShapeStyle {
/**
* Creates a new instance of RectangleStyle.
*
* @param style - The partial style provided by the user.
*/
constructor(style = {}) {
super();
const styleWithDefaults = Object.assign(Object.assign({}, RectangleStyle.DefaultStyle), style);
Object.assign(this, styleWithDefaults);
}
}
exports.RectangleStyle = RectangleStyle;
/**
* Default style for the rectangle.
*/
RectangleStyle.DefaultStyle = {
borderColor: '#000000',
borderWidth: 0,
color: '#000000',
cursor: Cursor_js_1.Cursor.Default
};