windows: Erase pre-calc'd number of chars instead of clearing whole line.
This commit is contained in:
parent
393d0c1679
commit
dc93f25bb8
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user