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