Commit dc93f25b authored by stijn's avatar stijn Committed by Damien George
Browse files

windows: Erase pre-calc'd number of chars instead of clearing whole line.

parent 393d0c16
......@@ -96,10 +96,9 @@ void mp_hal_erase_line_from_cursor(uint n_chars_to_erase) {
assure_conout_handle();
CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(con_out, &info);
const short len = info.dwSize.X - info.dwCursorPosition.X;
DWORD written;
FillConsoleOutputCharacter(con_out, ' ', len, info.dwCursorPosition, &written);
FillConsoleOutputAttribute(con_out, info.wAttributes, len, info.dwCursorPosition, &written);
FillConsoleOutputCharacter(con_out, ' ', n_chars_to_erase, info.dwCursorPosition, &written);
FillConsoleOutputAttribute(con_out, info.wAttributes, n_chars_to_erase, info.dwCursorPosition, &written);
}
typedef struct item_t {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment