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

1 line
50 KiB
Plaintext
Raw Normal View History

2025-01-04 00:34:03 +01:00
{"version":3,"file":"Graphics.mjs","sources":["../src/Graphics.ts"],"sourcesContent":["import {\n BLEND_MODES,\n Circle,\n Color,\n Ellipse,\n Matrix,\n PI_2,\n Point,\n Polygon,\n Rectangle,\n RoundedRectangle,\n Shader,\n SHAPES,\n State,\n Texture,\n UniformGroup,\n} from '@pixi/core';\nimport { Container } from '@pixi/display';\nimport { curves, LINE_CAP, LINE_JOIN } from './const';\nimport { GraphicsGeometry } from './GraphicsGeometry';\nimport { FillStyle } from './styles/FillStyle';\nimport { LineStyle } from './styles/LineStyle';\nimport { ArcUtils, BezierUtils, QuadraticUtils } from './utils';\n\nimport type { BatchDrawCall, ColorSource, IPointData, IShape, Renderer } from '@pixi/core';\nimport type { IDestroyOptions } from '@pixi/display';\n\n/**\n * Batch element computed from Graphics geometry.\n * @memberof PIXI\n */\nexport interface IGraphicsBatchElement\n{\n vertexData: Float32Array;\n blendMode: BLEND_MODES;\n indices: Uint16Array | Uint32Array;\n uvs: Float32Array;\n alpha: number;\n worldAlpha: number;\n _batchRGB: number[];\n _tintRGB: number;\n _texture: Texture;\n}\n\nexport interface IFillStyleOptions\n{\n color?: ColorSource;\n alpha?: number;\n texture?: Texture;\n matrix?: Matrix;\n}\n\nexport interface ILineStyleOptions extends IFillStyleOptions\n{\n width?: number;\n alignment?: number;\n native?: boolean;\n cap?: LINE_CAP;\n join?: LINE_JOIN;\n miterLimit?: number;\n}\n\n// a default shaders map used by graphics..\nconst DEFAULT_SHADERS: {[key: string]: Shader} = {};\n\nexport interface Graphics extends GlobalMixins.Graphics, Container {}\n\n/**\n * The Graphics class is primarily used to render primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them. However, you can also use a Graphics\n * object to build a list of primitives to use as a mask, or as a complex hitArea.\n *\n * Please note that due to legacy naming conventions, the behavior of some functions in this class\n * can be confusing. Each call to `drawRect()`, `drawPolygon()`, etc. actually stores that primitive\n * in the Geometry class's GraphicsGeometry object for later use in rendering or hit testing - the\n * functions do not directly draw anything to the screen. Similarly, the `clear()` function doesn't\n * change the screen, it simply resets the list of primitives, which can be useful if you want to\n * rebuild the contents of an existing Graphics object.\n *\n * Once a GraphicsGeometry list is built, you can re-use it in other Geometry objects as\n * an optimization, by passing it into a new Geometry object's constructor. Because of this\n * ability, it's important to call `destroy()` on Geometry objects once you are done with them, to\n * properly dereference each GraphicsGeometry and prevent memory leaks.\n * @memberof PIXI\n */\nexport class Graphics extends Container\n{\n /**\n * Graphics curves resolution settings. If `adaptive` flag is set to `true`,\n * the resolution is calculated based on the curve's length to ensure better visual quality.\n * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.\n * @static\n * @property {boolean} [adaptive=true] - flag indicating if the resolution should be adaptive\n * @property {number} [maxLength=10] - maximal length of a single segment of the curve (if adaptive = false, ignored)\n * @property {number} [minSegments=8] - minimal number of segments in the curve (if adaptive = false, ignored)\n * @property {number} [maxSegments=2048] - maximal number of segments in the curve (if adaptive = false, ignored)\n * @property {number} [epsilon=0.0001] - precision of the curve fitting\n */\n public static readonly curves = curves;\n\n /**\n * Temporary point to use for containsPoint.\n * @private\n */\n static _TEMP_POINT = new Point();\n\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shar