added hight and width to canvas

This commit is contained in:
Djeeberjr 2022-02-20 14:21:25 +01:00
parent 008ee97fc1
commit dece90008a

View File

@ -40,6 +40,21 @@ abstract Canvas(Array<Array<Pixel>>) to Array<Array<Pixel>> {
this[y][x] = value; this[y][x] = value;
} }
} }
public function hight(): Int {
return this.length;
}
public function maxWidth() {
var max = 0;
for (i in 0...this.length){
if (this[i].length > max){
max = this[i].length;
}
}
return max;
}
} }
class CanvasKeyValueIterator{ class CanvasKeyValueIterator{