fix ts syntax for path

This commit is contained in:
thesved 2021-10-05 17:27:54 +02:00 committed by GitHub
parent 0e4c1c78a7
commit 1f83c13edf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 // prevent image resolution loss: render and copy img at current scale, instead of downscaling then rescaling
// recalculate for null transformation // 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; x = (x - this.options.x) * this.options.scale;
y = (y - this.options.y) * this.options.scale; y = (y - this.options.y) * this.options.scale;
width *= this.options.scale; width *= this.options.scale;