From dece90008aa426bf9a68d19bce82b3f8a43a51f7 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 20 Feb 2022 14:21:25 +0100 Subject: [PATCH] added hight and width to canvas --- src/lib/ui/Canvas.hx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib/ui/Canvas.hx b/src/lib/ui/Canvas.hx index eeca7cb..ff0ebc8 100644 --- a/src/lib/ui/Canvas.hx +++ b/src/lib/ui/Canvas.hx @@ -40,6 +40,21 @@ abstract Canvas(Array>) to Array> { 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{