From: Christian Heller Date: Sat, 31 Oct 2020 10:26:48 +0000 (+0100) Subject: Add safeguards against illegal rows/cols values. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/processes?a=commitdiff_plain;h=d2324a2fcb0d4562ff2da13bb7f92f291589d6b4;p=plomrogue2-experiments Add safeguards against illegal rows/cols values. --- diff --git a/new2/rogue_chat_nocanvas_monochrome.html b/new2/rogue_chat_nocanvas_monochrome.html index 754021f..96ad054 100644 --- a/new2/rogue_chat_nocanvas_monochrome.html +++ b/new2/rogue_chat_nocanvas_monochrome.html @@ -593,10 +593,16 @@ wasd_selector.addEventListener('input', function() { tui.init_wasd(); }, false); rows_selector.addEventListener('input', function() { + if (rows_selector.value % 2 != 0) { + return; + } terminal.initialize(); tui.full_refresh(); }, false); cols_selector.addEventListener('input', function() { + if (cols_selector.value % 4 != 0) { + return; + } terminal.initialize(); tui.window_width = terminal.cols / 2, tui.full_refresh();