{"version":3,"file":"graphics.mjs","sources":["../../../src/components/pixi/graphics.ts"],"sourcesContent":["import { Graphics as PixiGraphics, GraphicsContext } from 'pixi.js';\nimport { BaseView, type ViewOptions } from './base';\n\n/**\n * A specialized wrapper around the PixiJS Graphics class that implements leaf node behavior similar to HTML elements\n * that supports additional layout properties.\n * e.g objectFit, objectPosition, backgroundColor, borderColor, and overflow properties.\n */\nexport class LayoutGraphics extends BaseView<PixiGraphics> {\n    constructor(opts: ConstructorParameters<typeof PixiGraphics>[0] & ViewOptions) {\n        if (opts instanceof GraphicsContext) {\n            opts = { context: opts };\n        }\n        super({\n            ...opts,\n            ClassType: PixiGraphics,\n        });\n    }\n}\n\n/**\n * A re-export of the PixiJS Graphics class that ensures the layout is set after construction.\n *\n * The Graphics object is a container for drawing shapes and lines.\n */\nexport class Graphics extends PixiGraphics {\n    constructor(opts: ConstructorParameters<typeof PixiGraphics>[0]) {\n        if (opts instanceof GraphicsContext) {\n            opts = { context: opts };\n        }\n        const { layout, ...options } = opts ?? {};\n\n        super(options);\n        this.layout = layout!;\n    }\n}\n"],"names":["PixiGraphics"],"mappings":";;AAQO,MAAM,uBAAuB,SAAuB;AAAA,EACvD,YAAY,MAAmE;AAC3E,QAAI,gBAAgB,iBAAiB;AAC1B,aAAA,EAAE,SAAS,KAAK;AAAA,IAAA;AAErB,UAAA;AAAA,MACF,GAAG;AAAA,MACH,WAAWA;AAAAA,IAAA,CACd;AAAA,EAAA;AAET;AAOO,MAAM,iBAAiBA,WAAa;AAAA,EACvC,YAAY,MAAqD;AAC7D,QAAI,gBAAgB,iBAAiB;AAC1B,aAAA,EAAE,SAAS,KAAK;AAAA,IAAA;AAE3B,UAAM,EAAE,QAAQ,GAAG,QAAQ,IAAI,QAAQ,CAAC;AAExC,UAAM,OAAO;AACb,SAAK,SAAS;AAAA,EAAA;AAEtB;"}