From: Christian Heller Date: Mon, 26 Oct 2020 22:56:46 +0000 (+0100) Subject: Fix box scale/position bug. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/index.html?a=commitdiff_plain;h=1a8d171cbb7e735d3d213247ba0d04e2ac6a374e;p=plomrogue2-experiments Fix box scale/position bug. --- diff --git a/new2/rogue_chat_nocanvas_monochrome.html b/new2/rogue_chat_nocanvas_monochrome.html index 97c0f08..df29814 100644 --- a/new2/rogue_chat_nocanvas_monochrome.html +++ b/new2/rogue_chat_nocanvas_monochrome.html @@ -44,12 +44,15 @@ let terminal = { drawBox: function(start_y, start_x, height, width) { let end_y = start_y + height; let end_x = start_x + width; - for (let y = start_y, x = start_x; y < end_y; x++) { - this.content[y][x] = ' '; + for (let y = start_y, x = start_x;; x++) { if (x == end_x) { - x = start_x - 1; - y += 1; - } + x = start_x; + y += 1; + if (y == end_y) { + break; + } + }; + this.content[y][x] = ' '; } }, }