fixed CanvasKeyValueIterator loop

This commit is contained in:
Djeeberjr 2022-05-06 12:51:24 +02:00
parent ec7535ccb6
commit 879e68d70d

View File

@ -106,18 +106,22 @@ class CanvasKeyValueIterator {
return null;
}
for (y in (this.index.y)...(this.canvas.length)){
var startX = this.index.x + 1;
for (y in this.index.y...this.canvas.length){
if (this.canvas[y] == null) {
continue;
}
for (x in (this.index.x + 1)...(this.canvas[y].length)){
for (x in startX...(this.canvas[y].length)){
if (this.canvas[y][x] == null) {
continue;
}
return {x: x, y: y};
}
startX = 0;
}
return null;
}