diff options
author | Canop <cano.petrole@gmail.com> | 2020-06-29 16:03:41 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-06-29 16:03:41 +0200 |
commit | 83dcfd8166e6f07e7c6bb811bfe5dc2f58aede04 (patch) | |
tree | e55bc8bd2831431d322cfb81f99dc9396888f64b /src/display/crop_writer.rs | |
parent | 93a5dcf11c9d1a35b429ac2bf3e164848c0f2ad5 (diff) |
version 0.18.2 - remove all flickering causesv0.18.2
Diffstat (limited to 'src/display/crop_writer.rs')
-rw-r--r-- | src/display/crop_writer.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/display/crop_writer.rs b/src/display/crop_writer.rs index 45758ba..1b6e508 100644 --- a/src/display/crop_writer.rs +++ b/src/display/crop_writer.rs @@ -1,8 +1,4 @@ use { - crossterm::{ - terminal::{Clear, ClearType}, - QueueableCommand, - }, termimad::{CompoundStyle, Result}, }; @@ -39,6 +35,13 @@ where } Ok(()) } + pub fn fill(&mut self, cs: &CompoundStyle, c: char) -> Result<()> { + while !self.is_full() { + self.allowed -= 1; + cs.queue(self.w, c)?; + } + Ok(()) + } pub fn queue_string(&mut self, cs: &CompoundStyle, s: String) -> Result<()> { if !self.is_full() { let len = s.chars().count(); @@ -57,8 +60,4 @@ where pub fn queue_bg(&mut self, cs: &CompoundStyle) -> Result<()> { cs.queue_bg(self.w) } - pub fn clear(&mut self, clear_type: ClearType) -> Result<()> { - self.w.queue(Clear(clear_type))?; - Ok(()) - } } |