From 3e97041cafa042a44861d610b2e74ef53759bb33 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Sat, 26 Jul 2025 12:08:59 +0100 Subject: [PATCH] cap window dimensions to console --- nx/source/runtime/devices/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx/source/runtime/devices/console.c b/nx/source/runtime/devices/console.c index fde12c30..3ff0d9c5 100644 --- a/nx/source/runtime/devices/console.c +++ b/nx/source/runtime/devices/console.c @@ -761,6 +761,9 @@ void consoleSetWindow(PrintConsole* console, int x, int y, int width, int height if (x < 1) x = 1; if (y < 1) y = 1; + if (x + width > console->consoleWidth ) width = console->consoleWidth + 1 - x; + if (y + height > console->consoleHeight ) height = console->consoleHeight + 1 - y; + console->windowWidth = width; console->windowHeight = height; console->windowX = x;