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

1 line
179 KiB
Plaintext
Raw Normal View History

2025-01-04 00:34:03 +01:00
{"version":3,"file":"pixi-graphics-smooth.mjs","sources":["../src/core/BatchDrawCall.ts","../src/core/BatchPart.ts","../src/core/FillStyle.ts","../src/core/LineStyle.ts","../src/core/BuildData.ts","../src/core/const.ts","../src/core/SegmentPacker.ts","../src/core/SmoothGraphicsData.ts","../src/shapes/CircleBuilder.ts","../src/shapes/PolyBuilder.ts","../src/shapes/RectangleBuilder.ts","../src/shapes/RoundedRectangleBuilder.ts","../src/shapes/index.ts","../src/SmoothGraphicsGeometry.ts","../src/SmoothShader.ts","../src/settings.ts","../src/SmoothGraphics.ts","../src/DashLineShader.ts"],"sourcesContent":["import { Matrix, BaseTexture, BatchTextureArray, Shader, Texture, BLEND_MODES } from '@pixi/core';\r\n/**\r\n * @memberof PIXI.smooth\r\n */\r\nexport interface IGraphicsBatchSettings\r\n{\r\n maxStyles: number;\r\n maxTextures: number;\r\n pixelLine: number;\r\n}\r\n\r\n/**\r\n * @memberof PIXI.smooth\r\n */\r\nexport function matrixEquals(th: Matrix, matrix: Matrix, eps = 1e-3)\r\n{\r\n return this === matrix || (Math.abs(th.a - matrix.a) < eps\r\n && Math.abs(th.b - matrix.b) < eps\r\n && Math.abs(th.c - matrix.c) < eps\r\n && Math.abs(th.d - matrix.d) < eps\r\n && Math.abs(th.tx - matrix.tx) < eps\r\n && Math.abs(th.ty - matrix.ty) < eps);\r\n}\r\n\r\n/**\r\n * @memberof PIXI.smooth\r\n */\r\nexport class BatchStyleArray\r\n{\r\n public textureIds: number[];\r\n public matrices: Matrix[];\r\n public lines: number[];\r\n public count: number;\r\n\r\n constructor()\r\n {\r\n this.textureIds = [];\r\n this.matrices = [];\r\n this.lines = [];\r\n this.count = 0;\r\n // TODO: mapCoord for atlas cases\r\n // TODO: gradients?\r\n }\r\n\r\n clear(): void\r\n {\r\n for (let i = 0; i < this.count; i++)\r\n {\r\n this.textureIds[i] = null;\r\n this.matrices[i] = null;\r\n }\r\n this.count = 0;\r\n }\r\n\r\n add(textureId: number, matrix: Matrix,\r\n lineWidth: number, lineAlignment: number, lineScaleMode: number,\r\n settings: IGraphicsBatchSettings): number\r\n {\r\n const { textureIds, matrices, lines, count } = this;\r\n\r\n textureId = (textureId * 4) + lineScaleMode;\r\n for (let i = 0; i < count; i++)\r\n {\r\n if (lines[i * 2] === lineWidth && lines[(i * 2) + 1] === lineAlignment\r\n && textureIds[i] === textureId && (matrixEquals(matrices[i], matrix)))\r\n {\r\n return i;\r\n }\r\n }\r\n if (count >= settings.maxStyles)\r\n {\r\n return -1;\r\n }\r\n textureIds[count] = textureId;\r\n matrices[count] = matrix;\r\n lines[count * 2] = lineWidth;\r\n lines[(count * 2) + 1] = lineAlignment;\r\n this.count++;\r\n\r\n return count;\r\n }\r\n}\r\n\r\n/**\r\n * @memberof PIXI.smooth\r\n */\r\nexport class BatchDrawCall\r\n{\r\n texArray: BatchTextureArray;\r\n styleArray: BatchStyleArray;\r\n blend: BLEND_MODES;\r\n start: number;\r\n size: number;\r\n data: any;\r\n shader: Shader;\r\n TICK: number;\r\n settings: IGraphicsBatchSettings;\r\n\r\n constructor()\r\n {\r\n this.texArray = new BatchTextureArray();\r\n this.styleArray = new BatchStyleArray();\r\n this.shader = null;\r\n this.blend = BLEND_MODES.NORMAL;\r\n\r\n this.start = 0;\r\n this.size = 0;\r\n this.TICK = 0; // for filling textures\r\n this.settings = null;\r\n /**\r\n * data for uniforms or custom webgl state\r\n * @member {object}\r\n */\r\n this.data = null;\r\n }\r\n\r\n clear()\r\n {\r\n this.texArray.clear();\r\n this.styleArray.clear();\r\n this.settings = null;\r\n this.data = null;\r\n this.shader = null;\r\n }\r\n\r\n begin(settings: IGraphicsBatchSettings, shader: Shader)\r\n {\r\n this.TICK = ++BaseTexture._glo