This commit is contained in:
Manoj Ampalam 2016-09-30 13:22:26 -07:00
commit 59a0cf6881

View File

@ -55,6 +55,8 @@ int ScreenX;
int ScreenY;
int ScrollTop;
int ScrollBottom;
int LastCursorX;
int LastCursorY;
char *pSavedScreen = NULL;
static COORD ZeroCoord = {0,0};
@ -1141,7 +1143,7 @@ void ConScrollUp(int topline,int botline)
Fill.Attributes = ConsoleInfo.wAttributes;
Fill.Char.AsciiChar = ' ';
ScrollConsoleScreenBuffer( hOutputConsole,
BOOL bRet = ScrollConsoleScreenBuffer( hOutputConsole,
&ScrollRect,
&ClipRect,
destination,
@ -1185,7 +1187,7 @@ void ConScrollDown(int topline,int botline)
Fill.Attributes = ConsoleInfo.wAttributes;
Fill.Char.AsciiChar = ' ';
ScrollConsoleScreenBuffer( hOutputConsole,
BOOL bRet = ScrollConsoleScreenBuffer( hOutputConsole,
&ScrollRect,
NULL,
destination,
@ -1224,8 +1226,20 @@ void ConSetCursorPosition(int x, int y)
Coord.X = (short)(x);
Coord.Y = (short)(y);
if ((y > ConsoleInfo.dwSize.Y - 1) && y > LastCursorY) {
for(int n = LastCursorY; n < y; n++)
GoToNextLine();
}
if (y >= ConsoleInfo.dwSize.Y) {
Coord.Y = ConsoleInfo.dwSize.Y - 1;
}
if (!SetConsoleCursorPosition(hOutputConsole, Coord))
rc = GetLastError();
LastCursorX = x;
LastCursorY = y;
}
BOOL ConChangeCursor( CONSOLE_CURSOR_INFO *pCursorInfo )