UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

53 lines (52 loc) 1.45 kB
/** * @module Rectangle */ /** * Basic rectangle * <br><img src="./media/examples/rectangle.png" alt="rectangle demo"/> * @class * @extends Component */ export default class Rectangle extends Component { /** * @inheritDoc * @param {Object} definition - Rectangle definition * @return {Rectangle} */ static from(definition: any): Rectangle; /** * @typedef {Object} RectangleOrigins * @enum {String} * @prop {String} topLeft * @prop {String} topRight * @prop {String} topCenter * @prop {String} center * @prop {String} centerLeft * @prop {String} centerRight * @prop {String} bottomLeft * @prop {String} bottomRight * @prop {String} bottomCenter */ /** * @type {RectangleOrigins} */ static get origins(): any; /** * Rectangle constructor * @param {PositionDefinition} positionDefinition - Position in space * @param {Number} [width=0] - Horizontal size * @param {Number} [height=0] - Vertical size * @param {ComponentOptions} [options] - Drawing options */ constructor(positionDefinition: any, width?: number, height?: number, options?: any); /** * @type {Number} */ width: number; /** * @type {Number} */ height: number; } export type RectangleOrigins = any; import Component from "@pencil.js/component";