We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80599a5 commit 8903cb7Copy full SHA for 8903cb7
src/mode/buffered_graphics.rs
@@ -71,8 +71,12 @@ where
71
/// Clear the display buffer. You need to call `disp.flush()` for any effect on the screen
72
#[cfg(not(feature = "graphics"))]
73
pub fn clear(&mut self) {
74
+ self.clear_impl(false);
75
+ }
76
+
77
+ fn clear_impl(&mut self, value: bool) {
78
for b in self.mode.buffer.as_mut() {
- *b = 0;
79
+ *b = value as u8;
80
}
81
82
let (width, height) = self.dimensions();
@@ -226,6 +230,11 @@ where
226
230
227
231
Ok(())
228
232
233
234
+ fn clear(&mut self, color: Self::Color) -> Result<(), Self::Error> {
235
+ self.clear_impl(color.is_on());
236
+ Ok(())
237
229
238
239
240
#[cfg(feature = "graphics")]
0 commit comments