diff options
author | stijn <stijn@ignitron.net> | 2015-10-26 11:49:48 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-10-26 11:35:16 +0000 |
commit | dc93f25bb857568010f61594643adddca3e20040 (patch) | |
tree | 3ec5777daa856715b66968288df036f782117e3e | |
parent | 393d0c16799a4eda787886bc0c7fce0da3c4adb8 (diff) | |
download | micropython-dc93f25bb857568010f61594643adddca3e20040.tar.gz micropython-dc93f25bb857568010f61594643adddca3e20040.zip |
windows: Erase pre-calc'd number of chars instead of clearing whole line.
-rw-r--r-- | windows/windows_mphal.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c index db03571baa..2a803f1089 100644 --- a/windows/windows_mphal.c +++ b/windows/windows_mphal.c @@ -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 { |