mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 00:19:22 +02:00
cap window dimensions to console
This commit is contained in:
parent
a68c1e1c9c
commit
3e97041caf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user