summaryrefslogtreecommitdiffstats
path: root/src/display/screen.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/display/screen.rs')
-rw-r--r--src/display/screen.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/display/screen.rs b/src/display/screen.rs
index e08f60e..3ea1fe0 100644
--- a/src/display/screen.rs
+++ b/src/display/screen.rs
@@ -39,26 +39,18 @@ impl Screen {
self.set_terminal_size(w, h, con);
Ok(())
}
- /// move the cursor to x,y and clears the line.
- pub fn goto_clear(&self, w: &mut W, x: u16, y: u16) -> Result<(), ProgramError> {
- self.goto(w, x, y)?;
- self.clear_line(w)
- }
/// move the cursor to x,y
pub fn goto(&self, w: &mut W, x: u16, y: u16) -> Result<(), ProgramError> {
w.queue(cursor::MoveTo(x, y))?;
Ok(())
}
- /// clear the whole screen
- pub fn clear(&self, w: &mut W) -> Result<(), ProgramError> {
- w.queue(Clear(ClearType::All))?;
- Ok(())
- }
/// clear from the cursor to the end of line
pub fn clear_line(&self, w: &mut W) -> Result<(), ProgramError> {
w.queue(Clear(ClearType::UntilNewLine))?;
Ok(())
}
+ /// clear the area and everything to the right.
+ /// Should be used with parcimony as it could lead to flickering.
pub fn clear_area_to_right(&self, w: &mut W, area: &Area) -> Result<(), ProgramError> {
for y in area.top..area.top+area.height {
self.goto(w, area.left, y)?;