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

1 line
49 KiB
Plaintext
Raw Normal View History

2025-01-04 00:34:03 +01:00
{"version":3,"file":"SmoothGraphics.mjs","sources":["../src/SmoothGraphics.ts"],"sourcesContent":["import {\r\n Circle,\r\n Color,\r\n Ellipse,\r\n PI_2,\r\n Point,\r\n Polygon,\r\n Rectangle,\r\n RoundedRectangle,\r\n Matrix,\r\n SHAPES,\r\n utils,\r\n Texture,\r\n State,\r\n Renderer,\r\n Shader,\r\n BLEND_MODES,\r\n DRAW_MODES,\r\n MSAA_QUALITY,\r\n} from '@pixi/core';\r\n\r\nimport { curves, Graphics, graphicsUtils, LINE_JOIN, LINE_CAP } from '@pixi/graphics';\r\nimport { SmoothGraphicsGeometry } from './SmoothGraphicsGeometry';\r\nimport { Container } from '@pixi/display';\r\n\r\nimport type { ColorSource, IShape, IPointData } from '@pixi/core';\r\nimport type { IDestroyOptions } from '@pixi/display';\r\nimport { IGraphicsBatchSettings } from './core/BatchDrawCall';\r\nimport { FillStyle } from './core/FillStyle';\r\nimport { LINE_SCALE_MODE, LineStyle } from './core/LineStyle';\r\nimport { SmoothGraphicsShader } from './SmoothShader';\r\nimport { settings } from './settings';\r\n\r\nconst UnsmoothGraphics = Graphics;\r\nconst { BezierUtils, QuadraticUtils, ArcUtils } = graphicsUtils;\r\n\r\n// a default shaders map used by graphics..\r\nconst DEFAULT_SHADERS: { [key: string]: Shader } = {};\r\n\r\nexport interface IFillStyleOptions\r\n{\r\n color?: ColorSource;\r\n alpha?: number;\r\n texture?: Texture;\r\n matrix?: Matrix;\r\n smooth?: boolean;\r\n shader?: Shader;\r\n}\r\n\r\nexport interface ILineStyleOptions extends IFillStyleOptions\r\n{\r\n width?: number;\r\n alignment?: number;\r\n scaleMode?: LINE_SCALE_MODE;\r\n cap?: LINE_CAP;\r\n join?: LINE_JOIN;\r\n miterLimit?: number;\r\n}\r\n\r\n/**\r\n * @memberof PIXI.smooth\r\n */\r\nexport class SmoothGraphics extends Container\r\n{\r\n public static readonly curves = curves;\r\n\r\n static _TEMP_POINT = new Point();\r\n\r\n public shader: Shader;\r\n public shaderSettings: IGraphicsBatchSettings;\r\n public pluginName: string;\r\n public currentPath: Polygon;\r\n\r\n protected batches: Array<any>;\r\n protected batchTint: number;\r\n protected batchDirty: number;\r\n protected vertexData: Float32Array;\r\n\r\n protected _fillStyle: FillStyle;\r\n protected _lineStyle: LineStyle;\r\n protected _matrix: Matrix;\r\n protected _holeMode: boolean;\r\n protected _transformID: number;\r\n protected _tintColor: Color;\r\n\r\n private state: State;\r\n private _geometry: SmoothGraphicsGeometry;\r\n\r\n public get geometry(): SmoothGraphicsGeometry\r\n {\r\n return this._geometry;\r\n }\r\n\r\n constructor(geometry: SmoothGraphicsGeometry = null)\r\n {\r\n super();\r\n\r\n this._geometry = geometry || new SmoothGraphicsGeometry();\r\n this._geometry.refCount++;\r\n\r\n this.shader = null;\r\n\r\n this.shaderSettings = {\r\n maxStyles: settings.SHADER_MAX_STYLES,\r\n maxTextures: settings.SHADER_MAX_TEXTURES,\r\n pixelLine: settings.PIXEL_LINE,\r\n };\r\n\r\n this.state = State.for2d();\r\n\r\n this._fillStyle = new FillStyle();\r\n\r\n this._lineStyle = new LineStyle();\r\n\r\n this._matrix = null;\r\n\r\n this._holeMode = false;\r\n\r\n this.currentPath = null;\r\n\r\n this.batches = [];\r\n\r\n this.batchTint = -1;\r\n\r\n this.batchDirty = -1;\r\n\r\n this.vertexData = null;\r\n\r\n this.pluginName = 'smooth';\r\n\r\n this._transformID = -1;\r\n\r\n // Set default\r\n this._tintColor = new Color(0xFFFFFF);\r\n this.blendMode = BLEND_MODES.NORMAL;\r\n }\r\n\r\n public clone(): SmoothGraphics\r\n {\r\n this.finishPoly();\r\n\r\n return new SmoothGraphics(this._geometry);\r\n }\r\n\r\n public set blendMode(value: BLEND_MODES)\r\n {\r\n this.state.blendMode = value;\r\n }\r\n\r\n public get blendMode(): BLEND_MODES\r\n {\r\n return this.state.blendMode;\r\n }\r\n\r\n pub