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

1 line
46 KiB
Plaintext

{"version":3,"file":"GraphicsPath.mjs","sources":["../../../../../src/scene/graphics/shared/path/GraphicsPath.ts"],"sourcesContent":["import { Point } from '../../../../maths/point/Point';\nimport { uid } from '../../../../utils/data/uid';\nimport { warn } from '../../../../utils/logging/warn';\nimport { SVGToGraphicsPath } from '../svg/SVGToGraphicsPath';\nimport { ShapePath } from './ShapePath';\n\nimport type { Matrix } from '../../../../maths/matrix/Matrix';\nimport type { PointData } from '../../../../maths/point/PointData';\nimport type { Bounds } from '../../../container/bounds/Bounds';\nimport type { RoundedPoint } from './roundShape';\n\nexport interface PathInstruction\n{\n action: 'moveTo' | 'lineTo' | 'quadraticCurveTo' |\n 'bezierCurveTo' | 'arc' | 'closePath' |\n 'addPath' | 'arcTo' | 'ellipse' |\n 'rect' | 'roundRect' | 'arcToSvg' |\n 'poly' | 'circle' |\n 'regularPoly' | 'roundPoly' | 'roundShape' | 'filletRect' | 'chamferRect'\n data: any[];\n}\n\n/**\n * The `GraphicsPath` class is designed to represent a graphical path consisting of multiple drawing instructions.\n * This class serves as a collection of drawing commands that can be executed to render shapes and paths on a canvas or\n * similar graphical context. It supports high-level drawing operations like lines, arcs, curves, and more, enabling\n * complex graphic constructions with relative ease.\n */\nexport class GraphicsPath\n{\n public instructions: PathInstruction[] = [];\n\n /** unique id for this graphics path */\n public readonly uid: number = uid('graphicsPath');\n\n private _dirty = true;\n // needed for hit testing and bounds calculations\n private _shapePath: ShapePath;\n\n /**\n * Provides access to the internal shape path, ensuring it is up-to-date with the current instructions.\n * @returns The `ShapePath` instance associated with this `GraphicsPath`.\n */\n get shapePath(): ShapePath\n {\n if (!this._shapePath)\n {\n this._shapePath = new ShapePath(this);\n }\n\n if (this._dirty)\n {\n this._dirty = false;\n this._shapePath.buildPath();\n }\n\n return this._shapePath;\n }\n\n /**\n * Creates a `GraphicsPath` instance optionally from an SVG path string or an array of `PathInstruction`.\n * @param instructions - An SVG path string or an array of `PathInstruction` objects.\n */\n constructor(instructions?: string | PathInstruction[])\n {\n if (typeof instructions === 'string')\n {\n SVGToGraphicsPath(instructions, this);\n }\n else\n {\n this.instructions = instructions?.slice() ?? [];\n }\n }\n\n /**\n * Adds another `GraphicsPath` to this path, optionally applying a transformation.\n * @param path - The `GraphicsPath` to add.\n * @param transform - An optional transformation to apply to the added path.\n * @returns The instance of the current object for chaining.\n */\n public addPath(path: GraphicsPath, transform?: Matrix): this\n {\n path = path.clone();\n this.instructions.push({ action: 'addPath', data: [path, transform] });\n\n this._dirty = true;\n\n return this;\n }\n\n /**\n * Adds an arc to the path. The arc is centered at (x, y)\n * position with radius `radius` starting at `startAngle` and ending at `endAngle`.\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 radius of the arc.\n * @param startAngle - The starting angle of the arc, in radians.\n * @param endAngle - The ending angle of the arc, in radians.\n * @param counterclockwise - Specifies whether the arc should be drawn in the anticlockwise direction. False by default.\n * @returns The instance of the current object for chaining.\n */\n public arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): this;\n public arc(...args: [number, number, number, number, number, boolean]): this\n {\n this.instructions.push({ action: 'arc', data: args });\n\n this._dirty = true;\n\n return this;\n }\n\n /**\n * Adds an arc to the path with the arc tangent to the line joining two specified points.\n * The arc radius is specified by `radius`.\n * @param x1 - The x-coordinate of the first point.\n * @param y1 - The y-coordinate of the first point.\n * @param x2 - The x-coordinate of the second point.\n * @param y2 - The y-coordinate of the second point.\n * @param radius - The radius of the arc.\n * @returns The instance of the current object for chaining.\n */\n public arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this;\n public arcTo(...args: [number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'arcTo', data: args });\n\n this._dirty = true;\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 // eslint-disable-next-line max-len\n public arcToSvg(rx: number, ry: number, xAxisRotation: number, largeArcFlag: number, sweepFlag: number, x: number, y: number): this;\n public arcToSvg(...args: [number, number, number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'arcToSvg', data: args });\n\n this._dirty = true;\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(\n cp1x: number, cp1y: number, cp2x: number, cp2y: number,\n x: number, y: number,\n smoothness?: number\n ): this;\n public bezierCurveTo(...args: [number, number, number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'bezierCurveTo', data: args });\n\n this._dirty = true;\n\n return this;\n }\n\n /**\n * Adds a cubic Bezier curve to the path.\n * It requires two points: the second control point and the end point. The first control point is assumed to be\n * The starting point is the last point in the current path.\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 bezierCurveToShort(cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): this\n {\n const last = this.instructions[this.instructions.length - 1];\n\n const lastPoint = this.getLastPoint(Point.shared);\n\n let cp1x = 0;\n let cp1y = 0;\n\n if (!last || last.action !== 'bezierCurveTo')\n {\n cp1x = lastPoint.x;\n cp1y = lastPoint.y;\n }\n else\n {\n cp1x = last.data[2];\n cp1y = last.data[3];\n\n const currentX = lastPoint.x;\n const currentY = lastPoint.y;\n\n cp1x = currentX + (currentX - cp1x);\n cp1y = currentY + (currentY - cp1y);\n }\n\n this.instructions.push({ action: 'bezierCurveTo', data: [cp1x, cp1y, cp2x, cp2y, x, y, smoothness] });\n\n this._dirty = true;\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.instructions.push({ action: 'closePath', data: [] });\n\n this._dirty = true;\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 * @param transform - An optional `Matrix` object to apply a transformation to the ellipse. This can include rotations.\n * @returns The instance of the current object for chaining.\n */\n public ellipse(x: number, y: number, radiusX: number, radiusY: number, matrix?: Matrix): this;\n public ellipse(...args: [number, number, number, number, Matrix]): this\n {\n this.instructions.push({ action: 'ellipse', data: args });\n\n // TODO nail this!\n\n this._dirty = true;\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 public lineTo(...args: [number, number]): this\n {\n this.instructions.push({ action: 'lineTo', data: args });\n\n this._dirty = true;\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 public moveTo(...args: [number, number]): this\n {\n this.instructions.push({ action: 'moveTo', data: args });\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 cp1x - The x-coordinate of the control point.\n * @param cp1y - 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 public quadraticCurveTo(...args: [number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'quadraticCurveTo', data: args });\n\n this._dirty = true;\n\n return this;\n }\n\n /**\n * Adds a quadratic curve to the path. It uses the previous point as 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 quadraticCurveToShort(x: number, y: number, smoothness?: number): this\n {\n // check if we have a previous quadraticCurveTo\n const last = this.instructions[this.instructions.length - 1];\n\n const lastPoint = this.getLastPoint(Point.shared);\n\n let cpx1 = 0;\n let cpy1 = 0;\n\n if (!last || last.action !== 'quadraticCurveTo')\n {\n cpx1 = lastPoint.x;\n cpy1 = lastPoint.y;\n }\n else\n {\n cpx1 = last.data[0];\n cpy1 = last.data[1];\n\n const currentX = lastPoint.x;\n const currentY = lastPoint.y;\n\n cpx1 = currentX + (currentX - cpx1);\n cpy1 = currentY + (currentY - cpy1);\n }\n\n this.instructions.push({ action: 'quadraticCurveTo', data: [cpx1, cpy1, x, y, smoothness] });\n\n this._dirty = true;\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 * @param transform - An optional `Matrix` object to apply a transformation to the rectangle.\n * @returns The instance of the current object for chaining.\n */\n public rect(x: number, y: number, w: number, h: number, transform?: Matrix): this\n {\n this.instructions.push({ action: 'rect', data: [x, y, w, h, transform] });\n\n this._dirty = true;\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 * @param transform - An optional `Matrix` object to apply a transformation to the circle.\n * @returns The instance of the current object for chaining.\n */\n public circle(x: number, y: number, radius: number, transform?: Matrix): this\n {\n this.instructions.push({ action: 'circle', data: [x, y, radius, transform] });\n\n this._dirty = true;\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 * @param transform - An optional `Matrix` object to apply a transformation to the rectangle.\n * @returns The instance of the current object for chaining.\n */\n public roundRect(x: number, y: number, w: number, h: number, radius?: number, transform?: Matrix): this;\n public roundRect(...args: [number, number, number, number, number, Matrix?]): this\n {\n this.instructions.push({ action: 'roundRect', data: args });\n\n this._dirty = true;\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 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 * @param transform - An optional `Matrix` object to apply a transformation to the polygon.\n * @returns The instance of the current object for chaining further drawing commands.\n */\n public poly(points: number[] | PointData[], close?: boolean, transform?: Matrix): this;\n public poly(...args: [number[] | PointData[], boolean, Matrix?]): this\n {\n this.instructions.push({ action: 'poly', data: args });\n\n this._dirty = true;\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?: number, transform?: Matrix): this;\n public regularPoly(...args: [number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'regularPoly', data: args });\n\n this._dirty = true;\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 public roundPoly(...args: [number, number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'roundPoly', data: args });\n\n this._dirty = true;\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 public roundShape(...args: [RoundedPoint[], number, boolean, number]): this\n {\n this.instructions.push({ action: 'roundShape', data: args });\n\n this._dirty = true;\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 public filletRect(...args: [number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'filletRect', data: args });\n\n this._dirty = true;\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 public chamferRect(...args: [number, number, number, number, number]): this\n {\n this.instructions.push({ action: 'chamferRect', data: args });\n\n this._dirty = true;\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 * @param transform - An optional `Matrix` object to apply a transformation to the star.\n * This can include rotations, scaling, and translations.\n * @returns The instance of the current object for chaining further drawing commands.\n */\n // eslint-disable-next-line max-len\n public star(x: number, y: number, points: number, radius: number, innerRadius?: number, rotation?: number, transform?: Matrix): this\n {\n innerRadius = innerRadius || radius / 2;\n\n const startAngle = (-1 * Math.PI / 2) + rotation;\n const len = points * 2;\n const delta = (Math.PI * 2) / len;\n const polygon = [];\n\n for (let i = 0; i < len; i++)\n {\n const r = i % 2 ? innerRadius : radius;\n const angle = (i * delta) + startAngle;\n\n polygon.push(\n x + (r * Math.cos(angle)),\n y + (r * Math.sin(angle))\n );\n }\n\n this.poly(polygon, true, transform);\n\n return this;\n }\n\n /**\n * Creates a copy of the current `GraphicsPath` instance. This method supports both shallow and deep cloning.\n * A shallow clone copies the reference of the instructions array, while a deep clone creates a new array and\n * copies each instruction individually, ensuring that modifications to the instructions of the cloned `GraphicsPath`\n * do not affect the original `GraphicsPath` and vice versa.\n * @param deep - A boolean flag indicating whether the clone should be deep.\n * @returns A new `GraphicsPath` instance that is a clone of the current instance.\n */\n public clone(deep = false): GraphicsPath\n {\n const newGraphicsPath2D = new GraphicsPath();\n\n if (!deep)\n {\n newGraphicsPath2D.instructions = this.instructions.slice();\n }\n else\n {\n for (let i = 0; i < this.instructions.length; i++)\n {\n const instruction = this.instructions[i];\n\n newGraphicsPath2D.instructions.push({ action: instruction.action, data: instruction.data.slice() });\n }\n }\n\n return newGraphicsPath2D;\n }\n\n public clear(): this\n {\n this.instructions.length = 0;\n this._dirty = true;\n\n return this;\n }\n\n /**\n * Applies a transformation matrix to all drawing instructions within the `GraphicsPath`.\n * This method enables the modification of the path's geometry according to the provided\n * transformation matrix, which can include translations, rotations, scaling, and skewing.\n *\n * Each drawing instruction in the path is updated to reflect the transformation,\n * ensuring the visual representation of the path is consistent with the applied matrix.\n *\n * Note: The transformation is applied directly to the coordinates and control points of the drawing instructions,\n * not to the path as a whole. This means the transformation's effects are baked into the individual instructions,\n * allowing for fine-grained control over the path's appearance.\n * @param matrix - A `Matrix` object representing the transformation to apply.\n * @returns The instance of the current object for chaining further operations.\n */\n public transform(matrix: Matrix): this\n {\n if (matrix.isIdentity()) return this;\n\n const a = matrix.a;\n const b = matrix.b;\n const c = matrix.c;\n const d = matrix.d;\n const tx = matrix.tx;\n const ty = matrix.ty;\n\n let x = 0;\n let y = 0;\n\n let cpx1 = 0;\n let cpy1 = 0;\n let cpx2 = 0;\n let cpy2 = 0;\n\n let rx = 0;\n let ry = 0;\n\n for (let i = 0; i < this.instructions.length; i++)\n {\n const instruction = this.instructions[i];\n const data = instruction.data as any[];\n\n switch (instruction.action)\n {\n case 'moveTo':\n case 'lineTo':\n\n x = data[0];\n y = data[1];\n\n data[0] = (a * x) + (c * y) + tx;\n data[1] = (b * x) + (d * y) + ty;\n break;\n case 'bezierCurveTo':\n\n cpx1 = data[0];\n cpy1 = data[1];\n cpx2 = data[2];\n cpy2 = data[3];\n\n x = data[4];\n y = data[5];\n\n data[0] = (a * cpx1) + (c * cpy1) + tx;\n data[1] = (b * cpx1) + (d * cpy1) + ty;\n data[2] = (a * cpx2) + (c * cpy2) + tx;\n data[3] = (b * cpx2) + (d * cpy2) + ty;\n data[4] = (a * x) + (c * y) + tx;\n data[5] = (b * x) + (d * y) + ty;\n break;\n\n case 'quadraticCurveTo':\n\n cpx1 = data[0];\n cpy1 = data[1];\n\n x = data[2];\n y = data[3];\n\n data[0] = (a * cpx1) + (c * cpy1) + tx;\n data[1] = (b * cpx1) + (d * cpy1) + ty;\n\n data[2] = (a * x) + (c * y) + tx;\n data[3] = (b * x) + (d * y) + ty;\n\n break;\n\n case 'arcToSvg':\n\n x = data[5];\n y = data[6];\n\n rx = data[0];\n ry = data[1];\n\n // multiply the radius by the transform..\n\n data[0] = (a * rx) + (c * ry);\n data[1] = (b * rx) + (d * ry);\n\n data[5] = (a * x) + (c * y) + tx;\n data[6] = (b * x) + (d * y) + ty;\n\n break;\n\n case 'circle':\n data[4] = adjustTransform(data[3], matrix);\n break;\n case 'rect':\n data[4] = adjustTransform(data[4], matrix);\n break;\n case 'ellipse':\n data[8] = adjustTransform(data[8], matrix);\n break;\n case 'roundRect':\n data[5] = adjustTransform(data[5], matrix);\n break;\n case 'addPath':\n data[0].transform(matrix);\n break;\n case 'poly':\n data[2] = adjustTransform(data[2], matrix);\n break;\n default:\n // #if _DEBUG\n warn('unknown transform action', instruction.action);\n // #endif\n break;\n }\n }\n\n this._dirty = true;\n\n return this;\n }\n\n get bounds(): Bounds\n {\n return this.shapePath.bounds;\n }\n\n /**\n * Retrieves the last point from the current drawing instructions in the `GraphicsPath`.\n * This method is useful for operations that depend on the path's current endpoint,\n * such as connecting subsequent shapes or paths. It supports various drawing instructions,\n * ensuring the last point's position is accurately determined regardless of the path's complexity.\n *\n * If the last instruction is a `closePath`, the method iterates backward through the instructions\n * until it finds an actionable instruction that defines a point (e.g., `moveTo`, `lineTo`,\n * `quadraticCurveTo`, etc.). For compound paths added via `addPath`, it recursively retrieves\n * the last point from the nested path.\n * @param out - A `Point` object where the last point's coordinates will be stored.\n * This object is modified directly to contain the result.\n * @returns The `Point` object containing the last point's coordinates.\n */\n public getLastPoint(out: Point): Point\n {\n let index = this.instructions.length - 1;\n\n let lastInstruction = this.instructions[index];\n\n if (!lastInstruction)\n {\n out.x = 0;\n out.y = 0;\n\n return out;\n }\n\n while (lastInstruction.action === 'closePath')\n {\n index--;\n\n if (index < 0)\n {\n out.x = 0;\n out.y = 0;\n\n return out;\n }\n\n lastInstruction = this.instructions[index];\n }\n\n switch (lastInstruction.action)\n {\n case 'moveTo':\n case 'lineTo':\n out.x = lastInstruction.data[0];\n out.y = lastInstruction.data[1];\n break;\n case 'quadraticCurveTo':\n out.x = lastInstruction.data[2];\n out.y = lastInstruction.data[3];\n break;\n case 'bezierCurveTo':\n out.x = lastInstruction.data[4];\n out.y = lastInstruction.data[5];\n break;\n case 'arc':\n case 'arcToSvg':\n out.x = lastInstruction.data[5];\n out.y = lastInstruction.data[6];\n break;\n case 'addPath':\n // TODO prolly should transform the last point of the path\n lastInstruction.data[0].getLastPoint(out);\n break;\n }\n\n return out;\n }\n}\n\nfunction adjustTransform(currentMatrix?: Matrix, transform?: Matrix): Matrix\n{\n if (currentMatrix)\n {\n return currentMatrix.prepend(transform);\n }\n\n return transform.clone();\n}\n"],"names":[],"mappings":";;;;;;;AA4BO,MAAM,YACb,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkCI,YAAY,YACZ,EAAA;AAlCA,IAAA,IAAA,CAAO,eAAkC,EAAC,CAAA;AAG1C;AAAA,IAAgB,IAAA,CAAA,GAAA,GAAc,IAAI,cAAc,CAAA,CAAA;AAEhD,IAAA,IAAA,CAAQ,MAAS,GAAA,IAAA,CAAA;AA8Bb,IAAI,IAAA,OAAO,iBAAiB,QAC5B,EAAA;AACI,MAAA,iBAAA,CAAkB,cAAc,IAAI,CAAA,CAAA;AAAA,KAGxC,MAAA;AACI,MAAA,IAAA,CAAK,YAAe,GAAA,YAAA,EAAc,KAAM,EAAA,IAAK,EAAC,CAAA;AAAA,KAClD;AAAA,GACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EA9BA,IAAI,SACJ,GAAA;AACI,IAAI,IAAA,CAAC,KAAK,UACV,EAAA;AACI,MAAK,IAAA,CAAA,UAAA,GAAa,IAAI,SAAA,CAAU,IAAI,CAAA,CAAA;AAAA,KACxC;AAEA,IAAA,IAAI,KAAK,MACT,EAAA;AACI,MAAA,IAAA,CAAK,MAAS,GAAA,KAAA,CAAA;AACd,MAAA,IAAA,CAAK,WAAW,SAAU,EAAA,CAAA;AAAA,KAC9B;AAEA,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBO,OAAA,CAAQ,MAAoB,SACnC,EAAA;AACI,IAAA,IAAA,GAAO,KAAK,KAAM,EAAA,CAAA;AAClB,IAAK,IAAA,CAAA,YAAA,CAAa,IAAK,CAA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