UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

2 lines 833 B
import{_defineProperty as e}from"../../_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.min.mjs";import{classRegistry as t}from"../ClassRegistry.min.mjs";import{FabricObject as n}from"./Object/FabricObject.min.mjs";var r=class e extends n{static getDefaults(){return{...super.getDefaults(),...e.ownDefaults}}constructor(t){super(),Object.assign(this,e.ownDefaults),this.setOptions(t)}_render(e){let t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this._renderPaintInOrder(e)}_toSVG(){let e=this.width/2,t=this.height/2;return[`<polygon `,`COMMON_PARTS`,`points="`,`${-e} ${t},0 ${-t},${e} ${t}`,`" />`]}};e(r,`type`,`Triangle`),e(r,`ownDefaults`,{width:100,height:100}),t.setClass(r),t.setSVGClass(r);export{r as Triangle}; //# sourceMappingURL=Triangle.min.mjs.map