Skip to content

Commit

Permalink
Loosen Graphics.drawPolygon types to use IPointData (pixijs#8573)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhazy committed Aug 10, 2022
1 parent eb64a3e commit e02c696
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/graphics/src/Graphics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,17 +720,17 @@ export class Graphics extends Container
return this.drawShape(new Ellipse(x, y, width, height));
}

public drawPolygon(...path: Array<number> | Array<Point>): this;
public drawPolygon(path: Array<number> | Array<Point> | Polygon): this;
public drawPolygon(...path: Array<number> | Array<IPointData>): this;
public drawPolygon(path: Array<number> | Array<IPointData> | Polygon): this;

/**
* Draws a polygon using the given path.
* @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.
* @param {number[]|PIXI.IPointData[]|PIXI.Polygon} path - The path data used to construct the polygon.
* @returns - This Graphics object. Good for chaining method calls
*/
public drawPolygon(...path: any[]): this
{
let points: Array<number> | Array<Point>;
let points: Array<number> | Array<IPointData>;
let closeStroke = true;// !!this._fillStyle;

const poly = path[0] as Polygon;
Expand Down

0 comments on commit e02c696

Please sign in to comment.