cap window dimensions to console

This commit is contained in:
Dave Murphy 2025-07-26 12:08:59 +01:00
parent a68c1e1c9c
commit 3e97041caf
No known key found for this signature in database
GPG Key ID: F7FD5492264BB9D0

View File

@ -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;