avoid garbage to the right of the "screen" by resetting color after each line
This commit is contained in:
parent
203f575914
commit
01a1b790ae
|
@ -141,9 +141,8 @@ impl RetroCallbacks for AnsiVideoComponent {
|
||||||
let processed = processor.process(&rgba_img).into_iter().next().unwrap().1;
|
let processed = processor.process(&rgba_img).into_iter().next().unwrap().1;
|
||||||
write!(self.screen, "{}", termion::cursor::Goto(1, 1)).unwrap();
|
write!(self.screen, "{}", termion::cursor::Goto(1, 1)).unwrap();
|
||||||
for line in self.encode_frame(&processed).lines() {
|
for line in self.encode_frame(&processed).lines() {
|
||||||
write!(self.screen, "{}\r\n", line).unwrap();
|
write!(self.screen, "{}\x1B[0m\r\n", line).unwrap();
|
||||||
}
|
}
|
||||||
write!(self.screen, "\x1B[0m").unwrap();
|
|
||||||
self.screen.flush().unwrap();
|
self.screen.flush().unwrap();
|
||||||
} else if force_redraw {
|
} else if force_redraw {
|
||||||
// TODO: draw last copy
|
// TODO: draw last copy
|
||||||
|
|
Loading…
Reference in New Issue