Skip to content
Snippets Groups Projects
Commit 491facd4 authored by Ticki's avatar Ticki
Browse files

Minor cosmetic changes

parent 0fde52e3
No related branches found
No related tags found
No related merge requests found
......@@ -31,17 +31,27 @@ pub trait TermControl {
/// Go to a given position.
fn goto(&mut self, x: u16, y: u16) -> IoResult<usize> {
self.csi(&[
(x / 10000) as u8 + b'0', (x / 1000) as u8 % 10 + b'0', (x / 100) as u8 % 10 + b'0', (x / 10) as u8 % 10 + b'0', x as u8 % 10 + b'0',
b';',
(y / 10000) as u8 + b'0', (y / 1000) as u8 % 10 + b'0', (y / 100) as u8 % 10 + b'0', (y / 10) as u8 % 10 + b'0', y as u8 % 10 + b'0',
b'H',
b'0' + (x / 10000) as u8,
b'0' + (x / 1000) as u8 % 10,
b'0' + (x / 100) as u8 % 10,
b'0' + (x / 10) as u8 % 10,
b'0' + x as u8 % 10,
b';',
b'0' + (y / 10000) as u8,
b'0' + (y / 1000) as u8 % 10,
b'0' + (y / 100) as u8 % 10,
b'0' + (y / 10) as u8 % 10,
b'0' + y as u8 % 10,
b'H',
])
}
/// Set graphic rendition.
fn rendition(&mut self, r: u8) -> IoResult<usize> {
self.csi(&[
r / 100 + b'0', r / 10 % 10 + b'0', r % 10 + b'0',
b'm',
b'0' + r / 100,
b'0' + r / 10 % 10,
b'0' + r % 10,
b'm',
])
}
/// Set foreground color
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment