From c0915a17991576e99a9c4245108557bab13137ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kol=C3=A1=C5=99?= Date: Wed, 1 Feb 2023 14:22:29 +0100 Subject: [PATCH] fix api node throttle and canvas size --- src/nodes/Api.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nodes/Api.ts b/src/nodes/Api.ts index 9fe250b..ecb4db6 100644 --- a/src/nodes/Api.ts +++ b/src/nodes/Api.ts @@ -90,6 +90,7 @@ export default class Api extends Node { if (this.updateThrottleWait !== this.in.throttleMs.value) { this.updateThrottleWait = this.in.throttleMs.value; + this.updateThrottled = throttle(this.upload, this.updateThrottleWait); } try { @@ -149,6 +150,8 @@ export default class Api extends Node { this.tempCanvas = createCanvas(width, height); } + this.tempCanvas.width = width; + this.tempCanvas.height = height; paintToCanvas(this.tempCanvas, media, { top: 0, left: 0, width, height, })