Files
nothoughts/node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContext.mjs.map
2025-08-04 18:57:35 +02:00

1 line
64 KiB
Plaintext

{"version":3,"file":"GraphicsContext.mjs","sources":["../../../../src/scene/graphics/shared/GraphicsContext.ts"],"sourcesContent":["/* eslint-disable max-len */\nimport EventEmitter from 'eventemitter3';\nimport { Color, type ColorSource } from '../../../color/Color';\nimport { Matrix } from '../../../maths/matrix/Matrix';\nimport { Point } from '../../../maths/point/Point';\nimport { Texture } from '../../../rendering/renderers/shared/texture/Texture';\nimport { uid } from '../../../utils/data/uid';\nimport { deprecation, v8_0_0 } from '../../../utils/logging/deprecation';\nimport { Bounds } from '../../container/bounds/Bounds';\nimport { GraphicsPath } from './path/GraphicsPath';\nimport { SVGParser } from './svg/SVGParser';\nimport { toFillStyle, toStrokeStyle } from './utils/convertFillInputToFillStyle';\n\nimport type { PointData } from '../../../maths/point/PointData';\nimport type { Shader } from '../../../rendering/renderers/shared/shader/Shader';\nimport type { TextureDestroyOptions, TypeOrBool } from '../../container/destroyTypes';\nimport type { ConvertedFillStyle, ConvertedStrokeStyle, FillInput, StrokeInput } from './FillTypes';\nimport type { RoundedPoint } from './path/roundShape';\n\nconst tmpPoint = new Point();\n\nexport type BatchMode = 'auto' | 'batch' | 'no-batch';\n\nexport interface FillInstruction\n{\n action: 'fill' | 'cut'\n data: { style: ConvertedFillStyle, path: GraphicsPath, hole?: GraphicsPath }\n}\n\nexport interface StrokeInstruction\n{\n action: 'stroke'\n data: { style: ConvertedStrokeStyle, path: GraphicsPath, hole?: GraphicsPath }\n}\n\nexport interface TextureInstruction\n{\n action: 'texture'\n data: {\n image: Texture,\n\n dx: number\n dy: number\n\n dw: number\n dh: number\n\n transform: Matrix\n alpha: number\n style: number,\n }\n}\n\nexport type GraphicsInstructions = FillInstruction | StrokeInstruction | TextureInstruction;\n\nconst tempMatrix = new Matrix();\n\n/**\n * The GraphicsContext class allows for the creation of lightweight objects that contain instructions for drawing shapes and paths.\n * It is used internally by the Graphics class to draw shapes and paths, and can be used directly and shared between Graphics objects,\n *\n * This sharing of a `GraphicsContext` means that the intensive task of converting graphics instructions into GPU-ready geometry is done once, and the results are reused,\n * much like sprites reusing textures.\n * @memberof scene\n */\nexport class GraphicsContext extends EventEmitter<{\n update: GraphicsContext\n destroy: GraphicsContext\n}>\n{\n /** The default fill style to use when none is provided. */\n public static defaultFillStyle: ConvertedFillStyle = {\n /** The color to use for the fill. */\n color: 0xffffff,\n /** The alpha value to use for the fill. */\n alpha: 1,\n /** The texture to use for the fill. */\n texture: Texture.WHITE,\n /** The matrix to apply. */\n matrix: null,\n /** The fill pattern to use. */\n fill: null,\n };\n\n /** The default stroke style to use when none is provided. */\n public static defaultStrokeStyle: ConvertedStrokeStyle = {\n /** The width of the stroke. */\n width: 1,\n /** The color to use for the stroke. */\n color: 0xffffff,\n /** The alpha value to use for the stroke. */\n alpha: 1,\n /** The alignment of the stroke. */\n alignment: 0.5,\n /** The miter limit to use. */\n miterLimit: 10,\n /** The line cap style to use. */\n cap: 'butt',\n /** The line join style to use. */\n join: 'miter',\n /** The texture to use for the fill. */\n texture: Texture.WHITE,\n /** The matrix to apply. */\n matrix: null,\n /** The fill pattern to use. */\n fill: null,\n };\n\n /** unique id for this graphics context */\n public readonly uid: number = uid('graphicsContext');\n public dirty = true;\n public batchMode: BatchMode = 'auto';\n public instructions: GraphicsInstructions[] = [];\n public customShader?: Shader;\n\n private _activePath: GraphicsPath = new GraphicsPath();\n private _transform: Matrix = new Matrix();\n\n private _fillStyle: ConvertedFillStyle = { ...GraphicsContext.defaultFillStyle };\n private _strokeStyle: ConvertedStrokeStyle = { ...GraphicsContext.defaultStrokeStyle };\n private _stateStack: { fillStyle: ConvertedFillStyle; strokeStyle: ConvertedStrokeStyle, transform: Matrix }[] = [];\n\n private _tick = 0;\n\n private _bounds = new Bounds();\n private _boundsDirty = true;\n\n /**\n * Creates a new GraphicsContext object that is a clone of this instance, copying all properties,\n * including the current drawing state, transformations, styles, and instructions.\n * @returns A new GraphicsContext instance with the same properties and state as this one.\n */\n public clone(): GraphicsContext\n {\n const clone = new GraphicsContext();\n\n clone.batchMode = this.batchMode;\n clone.instructions = this.instructions.slice();\n clone._activePath = this._activePath.clone();\n clone._transform = this._transform.clone();\n clone._fillStyle = { ...this._fillStyle };\n clone._strokeStyle = { ...this._strokeStyle };\n clone._stateStack = this._stateStack.slice();\n clone._bounds = this._bounds.clone();\n clone._boundsDirty = true;\n\n return clone;\n }\n\n /**\n * The current fill style of the graphics context. This can be a color, gradient, pattern, or a more complex style defined by a FillStyle object.\n */\n get fillStyle(): ConvertedFillStyle\n {\n return this._fillStyle;\n }\n\n set fillStyle(value: FillInput)\n {\n this._fillStyle = toFillStyle(value, GraphicsContext.defaultFillStyle);\n }\n\n /**\n * The current stroke style of the graphics context. Similar to fill styles, stroke styles can encompass colors, gradients, patterns, or more detailed configurations via a StrokeStyle object.\n */\n get strokeStyle(): ConvertedStrokeStyle\n {\n return this._strokeStyle;\n }\n\n set strokeStyle(value: FillInput)\n {\n this._strokeStyle = toStrokeStyle(value, GraphicsContext.defaultStrokeStyle);\n }\n\n /**\n * Sets the current fill style of the graphics context. The fill style can be a color, gradient,\n * pattern, or a more complex style defined by a FillStyle object.\n * @param style - The fill style to apply. This can be a simple color, a gradient or pattern object,\n * or a FillStyle or ConvertedFillStyle object.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public setFillStyle(style: FillInput): this\n {\n this._fillStyle = toFillStyle(style, GraphicsContext.defaultFillStyle);\n\n return this;\n }\n\n /**\n * Sets the current stroke style of the graphics context. Similar to fill styles, stroke styles can\n * encompass colors, gradients, patterns, or more detailed configurations via a StrokeStyle object.\n * @param style - The stroke style to apply. Can be defined as a color, a gradient or pattern,\n * or a StrokeStyle or ConvertedStrokeStyle object.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public setStrokeStyle(style: StrokeInput): this\n {\n this._strokeStyle = toFillStyle(style, GraphicsContext.defaultStrokeStyle) as ConvertedStrokeStyle;\n\n return this;\n }\n\n /**\n * Adds a texture to the graphics context. This method supports multiple overloads for specifying the texture, tint, and dimensions.\n * If only a texture is provided, it uses the texture's width and height for drawing. Additional parameters allow for specifying\n * a tint color, and custom dimensions for the texture drawing area.\n * @param texture - The Texture object to use.\n * @param tint - (Optional) A ColorSource to tint the texture. If not provided, defaults to white (0xFFFFFF).\n * @param dx - (Optional) The x-coordinate in the destination canvas at which to place the top-left corner of the source image.\n * @param dy - (Optional) The y-coordinate in the destination canvas at which to place the top-left corner of the source image.\n * @param dw - (Optional) The width of the rectangle within the source image to draw onto the destination canvas. If not provided, uses the texture's frame width.\n * @param dh - (Optional) The height of the rectangle within the source image to draw onto the destination canvas. If not provided, uses the texture's frame height.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public texture(texture: Texture): this;\n public texture(texture: Texture, tint: ColorSource): this;\n public texture(texture: Texture, tint: ColorSource, dx: number, dy: number): this;\n public texture(texture: Texture, tint: ColorSource, dx: number, dy: number, dw: number, dh: number): this;\n public texture(texture: Texture, tint?: ColorSource, dx?: number, dy?: number, dw?: number, dh?: number): this\n {\n this.instructions.push({\n action: 'texture',\n data: {\n image: texture,\n\n dx: dx || 0,\n dy: dy || 0,\n\n dw: dw || texture.frame.width,\n dh: dh || texture.frame.height,\n\n transform: this._transform.clone(),\n alpha: this._fillStyle.alpha,\n style: tint ? Color.shared.setValue(tint).toNumber() : 0xFFFFFF,\n }\n });\n\n this.onUpdate();\n\n return this;\n }\n\n /**\n * Resets the current path. Any previous path and its commands are discarded and a new path is\n * started. This is typically called before beginning a new shape or series of drawing commands.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public beginPath(): this\n {\n this._activePath = new GraphicsPath();\n\n return this;\n }\n\n /**\n * Fills the current or given path with the current fill style. This method can optionally take\n * a color and alpha for a simple fill, or a more complex FillInput object for advanced fills.\n * @param style - (Optional) The style to fill the path with. Can be a color, gradient, pattern, or a complex style object. If omitted, uses the current fill style.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public fill(style?: FillInput): this;\n /** @deprecated 8.0.0 */\n public fill(color: ColorSource, alpha: number): this;\n public fill(style?: FillInput, alpha?: number): this\n {\n let path: GraphicsPath;\n\n const lastInstruction = this.instructions[this.instructions.length - 1];\n\n if (this._tick === 0 && lastInstruction && lastInstruction.action === 'stroke')\n {\n path = lastInstruction.data.path;\n }\n else\n {\n path = this._activePath.clone();\n }\n\n if (!path) return this;\n\n // eslint-disable-next-line no-eq-null, eqeqeq\n if (style != null)\n {\n if (alpha !== undefined && typeof style === 'number')\n {\n // #if _DEBUG\n deprecation(v8_0_0, 'GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead');\n // #endif\n\n style = { color: style, alpha };\n }\n this._fillStyle = toFillStyle(style, GraphicsContext.defaultFillStyle);\n }\n\n // TODO not a fan of the clone!!\n this.instructions.push({\n action: 'fill',\n // TODO copy fill style!\n data: { style: this.fillStyle, path }\n });\n\n this.onUpdate();\n\n this._initNextPathLocation();\n this._tick = 0;\n\n return this;\n }\n\n private _initNextPathLocation()\n {\n // Reset the _activePath with the last point of the current path\n const { x, y } = this._activePath.getLastPoint(Point.shared);\n\n this._activePath.clear();\n this._activePath.moveTo(x, y);\n }\n\n /**\n * Strokes the current path with the current stroke style. This method can take an optional\n * FillInput parameter to define the stroke's appearance, including its color, width, and other properties.\n * @param style - (Optional) The stroke style to apply. Can be defined as a simple color or a more complex style object. If omitted, uses the current stroke style.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public stroke(style?: StrokeInput): this\n {\n let path: GraphicsPath;\n\n const lastInstruction = this.instructions[this.instructions.length - 1];\n\n if (this._tick === 0 && lastInstruction && lastInstruction.action === 'fill')\n {\n path = lastInstruction.data.path;\n }\n else\n {\n path = this._activePath.clone();\n }\n\n if (!path) return this;\n\n // eslint-disable-next-line no-eq-null, eqeqeq\n if (style != null)\n {\n this._strokeStyle = toStrokeStyle(style, GraphicsContext.defaultStrokeStyle);\n }\n\n // TODO not a fan of the clone!!\n this.instructions.push({\n action: 'stroke',\n // TODO copy fill style!\n data: { style: this.strokeStyle, path }\n });\n\n this.onUpdate();\n\n this._initNextPathLocation();\n this._tick = 0;\n\n return this;\n }\n\n /**\n * Applies a cutout to the last drawn shape. This is used to create holes or complex shapes by\n * subtracting a path from the previously drawn path. If a hole is not completely in a shape, it will\n * fail to cut correctly!\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public cut(): this\n {\n for (let i = 0; i < 2; i++)\n {\n const lastInstruction = this.instructions[this.instructions.length - 1 - i];\n\n const holePath = this._activePath.clone();\n\n if (lastInstruction)\n {\n if (lastInstruction.action === 'stroke' || lastInstruction.action === 'fill')\n {\n if (lastInstruction.data.hole)\n {\n lastInstruction.data.hole.addPath(holePath);\n }\n else\n {\n lastInstruction.data.hole = holePath;\n break;\n }\n }\n }\n }\n\n this._initNextPathLocation();\n\n return this;\n }\n\n /**\n * Adds an arc to the current path, which is centered at (x, y) with the specified radius,\n * starting and ending angles, and direction.\n * @param x - The x-coordinate of the arc's center.\n * @param y - The y-coordinate of the arc's center.\n * @param radius - The arc's radius.\n * @param startAngle - The starting angle, in radians.\n * @param endAngle - The ending angle, in radians.\n * @param counterclockwise - (Optional) Specifies whether the arc is drawn counterclockwise (true) or clockwise (false). Defaults to false.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): this\n {\n this._tick++;\n\n const t = this._transform;\n\n this._activePath.arc(\n (t.a * x) + (t.c * y) + t.tx,\n (t.b * x) + (t.d * y) + t.ty,\n radius,\n startAngle,\n endAngle,\n counterclockwise,\n );\n\n return this;\n }\n\n /**\n * Adds an arc to the current path with the given control points and radius, connected to the previous point\n * by a straight line if necessary.\n * @param x1 - The x-coordinate of the first control point.\n * @param y1 - The y-coordinate of the first control point.\n * @param x2 - The x-coordinate of the second control point.\n * @param y2 - The y-coordinate of the second control point.\n * @param radius - The arc's radius.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this\n {\n this._tick++;\n\n const t = this._transform;\n\n this._activePath.arcTo(\n (t.a * x1) + (t.c * y1) + t.tx,\n (t.b * x1) + (t.d * y1) + t.ty,\n (t.a * x2) + (t.c * y2) + t.tx,\n (t.b * x2) + (t.d * y2) + t.ty,\n radius,\n );\n\n return this;\n }\n\n /**\n * Adds an SVG-style arc to the path, allowing for elliptical arcs based on the SVG spec.\n * @param rx - The x-radius of the ellipse.\n * @param ry - The y-radius of the ellipse.\n * @param xAxisRotation - The rotation of the ellipse's x-axis relative\n * to the x-axis of the coordinate system, in degrees.\n * @param largeArcFlag - Determines if the arc should be greater than or less than 180 degrees.\n * @param sweepFlag - Determines if the arc should be swept in a positive angle direction.\n * @param x - The x-coordinate of the arc's end point.\n * @param y - The y-coordinate of the arc's end point.\n * @returns The instance of the current object for chaining.\n */\n public arcToSvg(\n rx: number, ry: number,\n xAxisRotation: number,\n largeArcFlag: number,\n sweepFlag: number,\n x: number, y: number\n ): this\n {\n this._tick++;\n\n const t = this._transform;\n\n this._activePath.arcToSvg(\n rx, ry,\n xAxisRotation, // should we rotate this with transform??\n largeArcFlag,\n sweepFlag,\n (t.a * x) + (t.c * y) + t.tx,\n (t.b * x) + (t.d * y) + t.ty,\n );\n\n return this;\n }\n\n /**\n * Adds a cubic Bezier curve to the path.\n * It requires three points: the first two are control points and the third one is the end point.\n * The starting point is the last point in the current path.\n * @param cp1x - The x-coordinate of the first control point.\n * @param cp1y - The y-coordinate of the first control point.\n * @param cp2x - The x-coordinate of the second control point.\n * @param cp2y - The y-coordinate of the second control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothness - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n public bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): this\n {\n this._tick++;\n\n // TODO optimize for no transform\n const t = this._transform;\n\n this._activePath.bezierCurveTo(\n (t.a * cp1x) + (t.c * cp1y) + t.tx,\n (t.b * cp1x) + (t.d * cp1y) + t.ty,\n (t.a * cp2x) + (t.c * cp2y) + t.tx,\n (t.b * cp2x) + (t.d * cp2y) + t.ty,\n (t.a * x) + (t.c * y) + t.tx,\n (t.b * x) + (t.d * y) + t.ty,\n smoothness,\n );\n\n return this;\n }\n\n /**\n * Closes the current path by drawing a straight line back to the start.\n * If the shape is already closed or there are no points in the path, this method does nothing.\n * @returns The instance of the current object for chaining.\n */\n public closePath(): this\n {\n this._tick++;\n\n this._activePath?.closePath();\n\n return this;\n }\n\n /**\n * Draws an ellipse at the specified location and with the given x and y radii.\n * An optional transformation can be applied, allowing for rotation, scaling, and translation.\n * @param x - The x-coordinate of the center of the ellipse.\n * @param y - The y-coordinate of the center of the ellipse.\n * @param radiusX - The horizontal radius of the ellipse.\n * @param radiusY - The vertical radius of the ellipse.\n * @returns The instance of the current object for chaining.\n */\n public ellipse(x: number, y: number, radiusX: number, radiusY: number): this\n {\n this._tick++;\n\n this._activePath.ellipse(x, y, radiusX, radiusY, this._transform.clone());\n\n return this;\n }\n\n /**\n * Draws a circle shape. This method adds a new circle path to the current drawing.\n * @param x - The x-coordinate of the center of the circle.\n * @param y - The y-coordinate of the center of the circle.\n * @param radius - The radius of the circle.\n * @returns The instance of the current object for chaining.\n */\n public circle(x: number, y: number, radius: number): this\n {\n this._tick++;\n\n this._activePath.circle(x, y, radius, this._transform.clone());\n\n return this;\n }\n\n /**\n * Adds another `GraphicsPath` to this path, optionally applying a transformation.\n * @param path - The `GraphicsPath` to add.\n * @returns The instance of the current object for chaining.\n */\n public path(path: GraphicsPath): this\n {\n this._tick++;\n\n this._activePath.addPath(path, this._transform.clone());\n\n return this;\n }\n\n /**\n * Connects the current point to a new point with a straight line. This method updates the current path.\n * @param x - The x-coordinate of the new point to connect to.\n * @param y - The y-coordinate of the new point to connect to.\n * @returns The instance of the current object for chaining.\n */\n public lineTo(x: number, y: number): this\n {\n this._tick++;\n\n const t = this._transform;\n\n this._activePath.lineTo(\n (t.a * x) + (t.c * y) + t.tx,\n (t.b * x) + (t.d * y) + t.ty\n );\n\n return this;\n }\n\n /**\n * Sets the starting point for a new sub-path. Any subsequent drawing commands are considered part of this path.\n * @param x - The x-coordinate for the starting point.\n * @param y - The y-coordinate for the starting point.\n * @returns The instance of the current object for chaining.\n */\n public moveTo(x: number, y: number): this\n {\n this._tick++;\n\n const t = this._transform;\n\n const instructions = this._activePath.instructions;\n\n const transformedX = (t.a * x) + (t.c * y) + t.tx;\n const transformedY = (t.b * x) + (t.d * y) + t.ty;\n\n if (instructions.length === 1 && instructions[0].action === 'moveTo')\n {\n instructions[0].data[0] = transformedX;\n instructions[0].data[1] = transformedY;\n\n return this;\n }\n this._activePath.moveTo(\n transformedX,\n transformedY\n );\n\n return this;\n }\n\n /**\n * Adds a quadratic curve to the path. It requires two points: the control point and the end point.\n * The starting point is the last point in the current path.\n * @param cpx - The x-coordinate of the control point.\n * @param cpy - The y-coordinate of the control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothness - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n public quadraticCurveTo(cpx: number, cpy: number, x: number, y: number, smoothness?: number): this\n {\n this._tick++;\n\n const t = this._transform;\n\n this._activePath.quadraticCurveTo(\n (t.a * cpx) + (t.c * cpy) + t.tx,\n (t.b * cpx) + (t.d * cpy) + t.ty,\n (t.a * x) + (t.c * y) + t.tx,\n (t.b * x) + (t.d * y) + t.ty,\n smoothness,\n );\n\n return this;\n }\n\n /**\n * Draws a rectangle shape. This method adds a new rectangle path to the current drawing.\n * @param x - The x-coordinate of the top-left corner of the rectangle.\n * @param y - The y-coordinate of the top-left corner of the rectangle.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @returns The instance of the current object for chaining.\n */\n public rect(x: number, y: number, w: number, h: number): this\n {\n this._tick++;\n\n this._activePath.rect(x, y, w, h, this._transform.clone());\n\n return this;\n }\n\n /**\n * Draws a rectangle with rounded corners.\n * The corner radius can be specified to determine how rounded the corners should be.\n * An optional transformation can be applied, which allows for rotation, scaling, and translation of the rectangle.\n * @param x - The x-coordinate of the top-left corner of the rectangle.\n * @param y - The y-coordinate of the top-left corner of the rectangle.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @param radius - The radius of the rectangle's corners. If not specified, corners will be sharp.\n * @returns The instance of the current object for chaining.\n */\n public roundRect(x: number, y: number, w: number, h: number, radius?: number): this\n {\n this._tick++;\n\n this._activePath.roundRect(x, y, w, h, radius, this._transform.clone());\n\n return this;\n }\n\n /**\n * Draws a polygon shape by specifying a sequence of points. This method allows for the creation of complex polygons,\n * which can be both open and closed. An optional transformation can be applied, enabling the polygon to be scaled,\n * rotated, or translated as needed.\n * @param points - An array of numbers, or an array of PointData objects eg [{x,y}, {x,y}, {x,y}]\n * representing the x and y coordinates, of the polygon's vertices, in sequence.\n * @param close - A boolean indicating whether to close the polygon path. True by default.\n */\n public poly(points: number[] | PointData[], close?: boolean): this\n {\n this._tick++;\n\n this._activePath.poly(points, close, this._transform.clone());\n\n return this;\n }\n\n /**\n * Draws a regular polygon with a specified number of sides. All sides and angles are equal.\n * @param x - The x-coordinate of the center of the polygon.\n * @param y - The y-coordinate of the center of the polygon.\n * @param radius - The radius of the circumscribed circle of the polygon.\n * @param sides - The number of sides of the polygon. Must be 3 or more.\n * @param rotation - The rotation angle of the polygon, in radians. Zero by default.\n * @param transform - An optional `Matrix` object to apply a transformation to the polygon.\n * @returns The instance of the current object for chaining.\n */\n public regularPoly(x: number, y: number, radius: number, sides: number, rotation = 0, transform?: Matrix): this\n {\n this._tick++;\n this._activePath.regularPoly(x, y, radius, sides, rotation, transform);\n\n return this;\n }\n\n /**\n * Draws a polygon with rounded corners.\n * Similar to `regularPoly` but with the ability to round the corners of the polygon.\n * @param x - The x-coordinate of the center of the polygon.\n * @param y - The y-coordinate of the center of the polygon.\n * @param radius - The radius of the circumscribed circle of the polygon.\n * @param sides - The number of sides of the polygon. Must be 3 or more.\n * @param corner - The radius of the rounding of the corners.\n * @param rotation - The rotation angle of the polygon, in radians. Zero by default.\n * @returns The instance of the current object for chaining.\n */\n public roundPoly(x: number, y: number, radius: number, sides: number, corner: number, rotation?: number): this\n {\n this._tick++;\n this._activePath.roundPoly(x, y, radius, sides, corner, rotation);\n\n return this;\n }\n\n /**\n * Draws a shape with rounded corners. This function supports custom radius for each corner of the shape.\n * Optionally, corners can be rounded using a quadratic curve instead of an arc, providing a different aesthetic.\n * @param points - An array of `RoundedPoint` representing the corners of the shape to draw.\n * A minimum of 3 points is required.\n * @param radius - The default radius for the corners.\n * This radius is applied to all corners unless overridden in `points`.\n * @param useQuadratic - If set to true, rounded corners are drawn using a quadraticCurve\n * method instead of an arc method. Defaults to false.\n * @param smoothness - Specifies the smoothness of the curve when `useQuadratic` is true.\n * Higher values make the curve smoother.\n * @returns The instance of the current object for chaining.\n */\n public roundShape(points: RoundedPoint[], radius: number, useQuadratic?: boolean, smoothness?: number): this\n {\n this._tick++;\n this._activePath.roundShape(points, radius, useQuadratic, smoothness);\n\n return this;\n }\n\n /**\n * Draw Rectangle with fillet corners. This is much like rounded rectangle\n * however it support negative numbers as well for the corner radius.\n * @param x - Upper left corner of rect\n * @param y - Upper right corner of rect\n * @param width - Width of rect\n * @param height - Height of rect\n * @param fillet - accept negative or positive values\n */\n public filletRect(x: number, y: number, width: number, height: number, fillet: number): this\n {\n this._tick++;\n this._activePath.filletRect(x, y, width, height, fillet);\n\n return this;\n }\n\n /**\n * Draw Rectangle with chamfer corners. These are angled corners.\n * @param x - Upper left corner of rect\n * @param y - Upper right corner of rect\n * @param width - Width of rect\n * @param height - Height of rect\n * @param chamfer - non-zero real number, size of corner cutout\n * @param transform\n */\n public chamferRect(x: number, y: number, width: number, height: number, chamfer: number, transform?: Matrix): this\n {\n this._tick++;\n this._activePath.chamferRect(x, y, width, height, chamfer, transform);\n\n return this;\n }\n\n /**\n * Draws a star shape centered at a specified location. This method allows for the creation\n * of stars with a variable number of points, outer radius, optional inner radius, and rotation.\n * The star is drawn as a closed polygon with alternating outer and inner vertices to create the star's points.\n * An optional transformation can be applied to scale, rotate, or translate the star as needed.\n * @param x - The x-coordinate of the center of the star.\n * @param y - The y-coordinate of the center of the star.\n * @param points - The number of points of the star.\n * @param radius - The outer radius of the star (distance from the center to the outer points).\n * @param innerRadius - Optional. The inner radius of the star\n * (distance from the center to the inner points between the outer points).\n * If not provided, defaults to half of the `radius`.\n * @param rotation - Optional. The rotation of the star in radians, where 0 is aligned with the y-axis.\n * Defaults to 0, meaning one point is directly upward.\n * @returns The instance of the current object for chaining further drawing commands.\n */\n public star(x: number, y: number, points: number, radius: number, innerRadius = 0, rotation = 0): this\n {\n this._tick++;\n\n this._activePath.star(x, y, points, radius, innerRadius, rotation, this._transform.clone());\n\n return this;\n }\n\n /**\n * Parses and renders an SVG string into the graphics context. This allows for complex shapes and paths\n * defined in SVG format to be drawn within the graphics context.\n * @param svg - The SVG string to be parsed and rendered.\n */\n public svg(svg: string): this\n {\n this._tick++;\n\n SVGParser(svg, this);\n\n return this;\n }\n\n /**\n * Restores the most recently saved graphics state by popping the top of the graphics state stack.\n * This includes transformations, fill styles, and stroke styles.\n */\n public restore(): this\n {\n const state = this._stateStack.pop();\n\n if (state)\n {\n this._transform = state.transform;\n this._fillStyle = state.fillStyle;\n this._strokeStyle = state.strokeStyle;\n }\n\n return this;\n }\n\n /** Saves the current graphics state, including transformations, fill styles, and stroke styles, onto a stack. */\n public save(): this\n {\n this._stateStack.push({\n transform: this._transform.clone(),\n fillStyle: { ...this._fillStyle },\n strokeStyle: { ...this._strokeStyle },\n });\n\n return this;\n }\n\n /**\n * Returns the current transformation matrix of the graphics context.\n * @returns The current transformation matrix.\n */\n public getTransform(): Matrix\n {\n return this._transform;\n }\n\n /**\n * Resets the current transformation matrix to the identity matrix, effectively removing any transformations (rotation, scaling, translation) previously applied.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public resetTransform(): this\n {\n this._transform.identity();\n\n return this;\n }\n\n /**\n * Applies a rotation transformation to the graphics context around the current origin.\n * @param angle - The angle of rotation in radians.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public rotate(angle: number): this\n {\n this._transform.rotate(angle);\n\n return this;\n }\n\n /**\n * Applies a scaling transformation to the graphics context, scaling drawings by x horizontally and by y vertically.\n * @param x - The scale factor in the horizontal direction.\n * @param y - (Optional) The scale factor in the vertical direction. If not specified, the x value is used for both directions.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public scale(x: number, y: number = x): this\n {\n this._transform.scale(x, y);\n\n return this;\n }\n\n /**\n * Sets the current transformation matrix of the graphics context to the specified matrix or values.\n * This replaces the current transformation matrix.\n * @param a - The value for the a property of the matrix, or a Matrix object to use directly.\n * @param b - The value for the b property of the matrix.\n * @param c - The value for the c property of the matrix.\n * @param d - The value for the d property of the matrix.\n * @param dx - The value for the tx (translate x) property of the matrix.\n * @param dy - The value for the ty (translate y) property of the matrix.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public setTransform(transform: Matrix): this;\n public setTransform(a: number, b: number, c: number, d: number, dx: number, dy: number): this;\n public setTransform(a: number | Matrix, b?: number, c?: number, d?: number, dx?: number, dy?: number): this\n {\n if (a instanceof Matrix)\n {\n this._transform.set(a.a, a.b, a.c, a.d, a.tx, a.ty);\n\n return this;\n }\n\n this._transform.set(a, b, c, d, dx, dy);\n\n return this;\n }\n\n /**\n * Applies the specified transformation matrix to the current graphics context by multiplying the current matrix with the specified matrix.\n * @param a - The value for the a property of the matrix, or a Matrix object to use directly.\n * @param b - The value for the b property of the matrix.\n * @param c - The value for the c property of the matrix.\n * @param d - The value for the d property of the matrix.\n * @param dx - The value for the tx (translate x) property of the matrix.\n * @param dy - The value for the ty (translate y) property of the matrix.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public transform(transform: Matrix): this;\n public transform(a: number, b: number, c: number, d: number, dx: number, dy: number): this;\n public transform(a: number | Matrix, b?: number, c?: number, d?: number, dx?: number, dy?: number): this\n {\n if (a instanceof Matrix)\n {\n this._transform.append(a);\n\n return this;\n }\n\n tempMatrix.set(a, b, c, d, dx, dy);\n this._transform.append(tempMatrix);\n\n return this;\n }\n\n /**\n * Applies a translation transformation to the graphics context, moving the origin by the specified amounts.\n * @param x - The amount to translate in the horizontal direction.\n * @param y - (Optional) The amount to translate in the vertical direction. If not specified, the x value is used for both directions.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public translate(x: number, y: number = x): this\n {\n this._transform.translate(x, y);\n\n return this;\n }\n\n /**\n * Clears all drawing commands from the graphics context, effectively resetting it. This includes clearing the path,\n * and optionally resetting transformations to the identity matrix.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n public clear(): this\n {\n this._activePath.clear();\n this.instructions.length = 0;\n this.resetTransform();\n\n this.onUpdate();\n\n return this;\n }\n\n protected onUpdate(): void\n {\n if (this.dirty) return;\n\n this.emit('update', this, 0x10);\n this.dirty = true;\n this._boundsDirty = true;\n }\n\n /** The bounds of the graphic shape. */\n get bounds(): Bounds\n {\n if (!this._boundsDirty) return this._bounds;\n\n // TODO switch to idy dirty with tick..\n const bounds = this._bounds;\n\n bounds.clear();\n\n for (let i = 0; i < this.instructions.length; i++)\n {\n const instruction = this.instructions[i];\n const action = instruction.action;\n\n if (action === 'fill')\n {\n const data = instruction.data as FillInstruction['data'];\n\n bounds.addBounds(data.path.bounds);\n }\n else if (action === 'texture')\n {\n const data = instruction.data as TextureInstruction['data'];\n\n bounds.addFrame(data.dx, data.dy, data.dx + data.dw, data.dy + data.dh, data.transform);\n }\n if (action === 'stroke')\n {\n const data = instruction.data as StrokeInstruction['data'];\n\n const padding = data.style.width / 2;\n\n const _bounds = data.path.bounds;\n\n bounds.addFrame(\n _bounds.minX - padding,\n _bounds.minY - padding,\n _bounds.maxX + padding,\n _bounds.maxY + padding\n );\n }\n }\n\n return bounds;\n }\n\n /**\n * Check to see if a point is contained within this geometry.\n * @param point - Point to check if it's contained.\n * @returns {boolean} `true` if the point is contained within geometry.\n */\n public containsPoint(point: PointData): boolean\n {\n // early out if the bounding box is not hit\n if (!this.bounds.containsPoint(point.x, point.y)) return false;\n\n const instructions = this.instructions;\n let hasHit = false;\n\n for (let k = 0; k < instructions.length; k++)\n {\n const instruction = instructions[k];\n\n const data = instruction.data as FillInstruction['data'];\n const path = data.path;\n\n if (!instruction.action || !path) continue;\n\n const style = data.style;\n const shapes = path.shapePath.shapePrimitives;\n\n for (let i = 0; i < shapes.length; i++)\n {\n const shape = shapes[i].shape;\n\n if (!style || !shape) continue;\n\n const transform = shapes[i].transform;\n\n const transformedPoint = transform ? transform.applyInverse(point, tmpPoint) : point;\n\n if (instruction.action === 'fill')\n {\n hasHit = shape.contains(transformedPoint.x, transformedPoint.y);\n }\n else\n {\n hasHit = shape.strokeContains(transformedPoint.x, transformedPoint.y, (style as ConvertedStrokeStyle).width);\n }\n\n const holes = data.hole;\n\n if (holes)\n {\n const holeShapes = holes.shapePath?.shapePrimitives;\n\n if (holeShapes)\n {\n for (let j = 0; j < holeShapes.length; j++)\n {\n if (holeShapes[j].shape.contains(transformedPoint.x, transformedPoint.y))\n {\n hasHit = false;\n }\n }\n }\n }\n\n if (hasHit)\n {\n return true;\n }\n }\n }\n\n return hasHit;\n }\n\n /**\n * Destroys the GraphicsData object.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the fill/stroke style?\n * @param {boolean} [options.textureSource=false] - Should it destroy the texture source of the fill/stroke style?\n */\n public destroy(options: TypeOrBool<TextureDestroyOptions> = false): void\n {\n this._stateStack.length = 0;\n this._transform = null;\n\n this.emit('destroy', this);\n this.removeAllListeners();\n\n const destroyTexture = typeof options === 'boolean' ? options : options?.texture;\n\n if (destroyTexture)\n {\n const destroyTextureSource = typeof options === 'boolean' ? options : options?.textureSource;\n\n if (this._fillStyle.texture)\n {\n this._fillStyle.texture.destroy(destroyTextureSource);\n }\n\n if (this._strokeStyle.texture)\n {\n this._strokeStyle.texture.destroy(destroyTextureSource);\n }\n }\n\n this._fillStyle = null;\n this._strokeStyle = null;\n\n this.instructions = null;\n this._activePath = null;\n this._bounds = null;\n this._stateStack = null;\n this.customShader = null;\n this._transform = null;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAmBA,MAAM,QAAA,GAAW,IAAI,KAAM,EAAA,CAAA;AAoC3B,MAAM,UAAA,GAAa,IAAI,MAAO,EAAA,CAAA;AAUvB,MAAM,gBAAA,GAAN,MAAM,gBAAA,SAAwB,YAIrC,CAAA;AAAA,EAJO,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA,CAAA;AA4CH;AAAA,IAAgB,IAAA,CAAA,GAAA,GAAc,IAAI,iBAAiB,CAAA,CAAA;AACnD,IAAA,IAAA,CAAO,KAAQ,GAAA,IAAA,CAAA;AACf,IAAA,IAAA,CAAO,SAAuB,GAAA,MAAA,CAAA;AAC9B,IAAA,IAAA,CAAO,eAAuC,EAAC,CAAA;AAG/C,IAAQ,IAAA,CAAA,WAAA,GAA4B,IAAI,YAAa,EAAA,CAAA;AACrD,IAAQ,IAAA,CAAA,UAAA,GAAqB,IAAI,MAAO,EAAA,CAAA;AAExC,IAAA,IAAA,CAAQ,UAAiC,GAAA,EAAE,GAAG,gBAAA,CAAgB,gBAAiB,EAAA,CAAA;AAC/E,IAAA,IAAA,CAAQ,YAAqC,GAAA,EAAE,GAAG,gBAAA,CAAgB,kBAAmB,EAAA,CAAA;AACrF,IAAA,IAAA,CAAQ,cAAyG,EAAC,CAAA;AAElH,IAAA,IAAA,CAAQ,KAAQ,GAAA,CAAA,CAAA;AAEhB,IAAQ,IAAA,CAAA,OAAA,GAAU,IAAI,MAAO,EAAA,CAAA;AAC7B,IAAA,IAAA,CAAQ,YAAe,GAAA,IAAA,CAAA;AAAA,GAAA;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