From 1a1eadb0da8361ba4af7973c5bed7701a25c96be Mon Sep 17 00:00:00 2001 From: Michael Enion Date: Tue, 23 Jul 2024 07:39:47 -0700 Subject: [PATCH] Ensure from/toCartesianCoords uses PIXI.Point for rotate --- RegularPolygon/RegularPolygon.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/RegularPolygon/RegularPolygon.js b/RegularPolygon/RegularPolygon.js index c5618f6..8f7d42e 100644 --- a/RegularPolygon/RegularPolygon.js +++ b/RegularPolygon/RegularPolygon.js @@ -198,8 +198,7 @@ export class RegularPolygon extends PIXI.Polygon { fromCartesianCoords(a, outPoint) { const { x, y } = this.origin; outPoint ??= new PIXI.Point; - a = PIXI.Point.fromObject(a); - + a = PIXI.Point._tmp.copyFrom(a); a.translate(-x, -y, outPoint).rotate(-this.radians, outPoint); return outPoint; } @@ -213,8 +212,7 @@ export class RegularPolygon extends PIXI.Polygon { toCartesianCoords(a, outPoint) { const { x, y } = this.origin; outPoint ??= new PIXI.Point; - a = PIXI.Point.fromObject(a); - + a = PIXI.Point._tmp.copyFrom(a); a.rotate(this.radians, outPoint).translate(x, y, outPoint); return outPoint; }