no internal canvas error if inputs to new costume are 0, just return an empty costume

pull/89/head
Bernat Romagosa 2019-11-04 11:41:11 +01:00
rodzic 5cf62d5219
commit 87931cdab0
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -5109,6 +5109,9 @@ Process.prototype.reportNewCostume = function (pixels, width, height, name) {
}
width = Math.abs(Math.floor(+width));
height = Math.abs(Math.floor(+height));
if (width <= 0 || height <= 0) {
return new Costume();
}
if (!isFinite(width * height) || isNaN(width * height)) {
throw new Error(
'expecting a finite number\nbut getting Infinity or NaN'