fix api node throttle and canvas size

This commit is contained in:
Michal Kolář
2023-02-01 14:22:29 +01:00
committed by Stanislav Fifik
parent ba65d90627
commit c0915a1799

View File

@@ -90,6 +90,7 @@ export default class Api extends Node<typeof inputs, typeof outputs> {
if (this.updateThrottleWait !== this.in.throttleMs.value) { if (this.updateThrottleWait !== this.in.throttleMs.value) {
this.updateThrottleWait = this.in.throttleMs.value; this.updateThrottleWait = this.in.throttleMs.value;
this.updateThrottled = throttle(this.upload, this.updateThrottleWait);
} }
try { try {
@@ -149,6 +150,8 @@ export default class Api extends Node<typeof inputs, typeof outputs> {
this.tempCanvas = createCanvas(width, height); this.tempCanvas = createCanvas(width, height);
} }
this.tempCanvas.width = width;
this.tempCanvas.height = height;
paintToCanvas(this.tempCanvas, media, { paintToCanvas(this.tempCanvas, media, {
top: 0, left: 0, width, height, top: 0, left: 0, width, height,
}) })