mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Ticket #2157: fixed tty_fill_region() for ncurses-based TTY layer.
If filled region is larger than screen, NCurses doesn't fill it unlike S-Lang. This patch fixes such behaviour: only visible part of region is filled. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
7843203257
commit
2c7bc9c1c2
@ -295,6 +295,31 @@ tty_fill_region (int y, int x, int rows, int cols, unsigned char ch)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (y < 0)
|
||||
{
|
||||
rows += y;
|
||||
|
||||
if (rows <= 0)
|
||||
return;
|
||||
|
||||
y = 0;
|
||||
}
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
cols += x;
|
||||
|
||||
if (cols <= 0)
|
||||
return;
|
||||
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (y + rows > LINES)
|
||||
rows = LINES - y;
|
||||
if (x + cols > COLS)
|
||||
cols = COLS - x;
|
||||
|
||||
for (i = 0; i < rows; i++)
|
||||
{
|
||||
move (y + i, x);
|
||||
|
Loading…
Reference in New Issue
Block a user