Files
Foundry-VTT-Docker/resources/app/node_modules/@pixi/graphics-smooth/lib/SmoothGraphicsGeometry.mjs.map

1 line
48 KiB
Plaintext
Raw Normal View History

2025-01-04 00:34:03 +01:00
{"version":3,"file":"SmoothGraphicsGeometry.mjs","sources":["../src/SmoothGraphicsGeometry.ts"],"sourcesContent":["import { SmoothGraphicsData } from './core/SmoothGraphicsData';\r\n\r\nimport { FILL_COMMANDS } from './shapes';\r\n\r\nimport {\r\n Buffer,\r\n Color,\r\n Geometry,\r\n Texture,\r\n WRAP_MODES,\r\n TYPES,\r\n SHAPES,\r\n Point,\r\n Matrix,\r\n} from '@pixi/core';\r\n\r\nimport { Bounds } from '@pixi/display';\r\n\r\nimport type { Circle, Ellipse, Polygon, Rectangle, RoundedRectangle, IPointData } from '@pixi/core';\r\nimport { BuildData } from './core/BuildData';\r\nimport { SegmentPacker } from './core/SegmentPacker';\r\nimport { LineStyle } from './core/LineStyle';\r\nimport { FillStyle } from './core/FillStyle';\r\nimport { BatchPart } from './core/BatchPart';\r\nimport { BatchDrawCall, IGraphicsBatchSettings, matrixEquals } from './core/BatchDrawCall';\r\n\r\n/*\r\n * Complex shape type\r\n * @todo Move to Math shapes\r\n */\r\nexport type IShape = Circle | Ellipse | Polygon | Rectangle | RoundedRectangle;\r\n\r\nexport const BATCH_POOL: Array<BatchPart> = [];\r\nexport const DRAW_CALL_POOL: Array<BatchDrawCall> = [];\r\n\r\nconst tmpPoint = new Point();\r\nconst tmpBounds = new Bounds();\r\n\r\n/**\r\n * @memberof PIXI.smooth\r\n */\r\nexport class SmoothGraphicsGeometry extends Geometry\r\n{\r\n public static BATCHABLE_SIZE = 100;\r\n\r\n public boundsPadding: number;\r\n\r\n indicesUint16: Uint16Array | Uint32Array = null;\r\n batchable: boolean;\r\n\r\n buildData: BuildData;\r\n\r\n get points()\r\n {\r\n return this.buildData.verts;\r\n }\r\n\r\n get closePointEps()\r\n {\r\n return this.buildData.closePointEps;\r\n }\r\n\r\n graphicsData: Array<SmoothGraphicsData>;\r\n drawCalls: Array<BatchDrawCall>;\r\n batchDirty: number;\r\n batches: Array<BatchPart>;\r\n packer: SegmentPacker;\r\n packSize: number;\r\n pack32index: boolean;\r\n strideFloats: number;\r\n\r\n protected dirty: number;\r\n protected cacheDirty: number;\r\n protected clearDirty: number;\r\n protected shapeBuildIndex: number;\r\n protected shapeBatchIndex: number;\r\n protected _bounds: Bounds;\r\n protected boundsDirty: number;\r\n\r\n _buffer: Buffer;\r\n _indexBuffer: Buffer;\r\n _bufferFloats: Float32Array;\r\n _bufferUint: Uint32Array;\r\n\r\n initAttributes(_static: boolean)\r\n {\r\n this._buffer = new Buffer(null, _static, false);\r\n this._bufferFloats = new Float32Array();\r\n this._bufferUint = new Uint32Array();\r\n\r\n this._indexBuffer = new Buffer(null, _static, true);\r\n this.addAttribute('aPrev', this._buffer, 2, false, TYPES.FLOAT)\r\n .addAttribute('aPoint1', this._buffer, 2, false, TYPES.FLOAT)\r\n .addAttribute('aPoint2', this._buffer, 2, false, TYPES.FLOAT)\r\n .addAttribute('aNext', this._buffer, 2, false, TYPES.FLOAT)\r\n .addAttribute('aTravel', this._buffer, 1, false, TYPES.FLOAT)\r\n // number of vertex\r\n .addAttribute('aVertexJoint', this._buffer, 1, false, TYPES.FLOAT)\r\n // line width, alignment\r\n .addAttribute('aStyleId', this._buffer, 1, false, TYPES.FLOAT)\r\n // the usual\r\n .addAttribute('aColor', this._buffer, 4, true, TYPES.UNSIGNED_BYTE)\r\n .addIndex(this._indexBuffer);\r\n\r\n this.strideFloats = 12;\r\n }\r\n\r\n constructor()\r\n {\r\n super();\r\n\r\n this.initAttributes(false);\r\n\r\n this.buildData = new BuildData();\r\n\r\n this.graphicsData = [];\r\n\r\n this.dirty = 0;\r\n\r\n this.batchDirty = -1;\r\n\r\n this.cacheDirty = -1;\r\n\r\n this.clearDirty = 0;\r\n\r\n this.drawCalls = [];\r\n\r\n this.batches = [];\r\n\r\n this.shapeBuildIndex = 0;\r\n\r\n this.shapeBatchIndex = 0;\r\n\r\n this._bounds = new Bounds();\r\n\r\n this.boundsDirty = -1;\r\n\r\n this.boundsPaddin