From 1f83c13edf095e59be8a7bcbe38dd4b146e688fa Mon Sep 17 00:00:00 2001 From: thesved <2893181+thesved@users.noreply.github.com> Date: Tue, 5 Oct 2021 17:27:54 +0200 Subject: [PATCH] fix ts syntax for path --- src/render/canvas/canvas-renderer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/render/canvas/canvas-renderer.ts b/src/render/canvas/canvas-renderer.ts index 7028cd9..e828d48 100644 --- a/src/render/canvas/canvas-renderer.ts +++ b/src/render/canvas/canvas-renderer.ts @@ -603,7 +603,9 @@ export class CanvasRenderer extends Renderer { ]); // prevent image resolution loss: render and copy img at current scale, instead of downscaling then rescaling // recalculate for null transformation - path = path.map(function(v){v.x = (v.x-this.options.x)*this.options.scale; v.y = (v.y-this.options.y)*this.options.scale; return v}); + path = (path as Vector[]).map(v => { + return new Vector((v.x-this.options.x)*this.options.scale, (v.y-this.options.y)*this.options.scale); + }); x = (x - this.options.x) * this.options.scale; y = (y - this.options.y) * this.options.scale; width *= this.options.scale;