diff --git a/src/lib.rs b/src/lib.rs index 459a8c3..6bbc732 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,7 +75,7 @@ pub struct DoubleFrame { } /// The colour of a given pixel. -/// +/// /// Since the GDEQ031T10 is pure black-and-white (no greyscale), this is just a two-state enum.S pub enum PixelColour { Black = 0, @@ -83,7 +83,7 @@ pub enum PixelColour { } /// A trait for partial window strategies for use with [DoubleFrame]. -/// +/// /// This trait is sealed, so the only strategies available are [NoPartialWindow] /// and [AutomaticPartialWindow]. pub trait ApplyPartialWindow: private::Sealed { @@ -100,7 +100,7 @@ pub trait ApplyPartialWindow: private::Sealed { ); /// Add a new bounding box which must be covered by the partial window. - /// + /// /// Calls to this method accumulate, meaning all bounding boxes will be covered by the /// partial window until [ApplyPartialWindow::reset_partial_window] is called. fn update_partial_window(&mut self, min_x: u16, max_x: u16, min_y: u16, max_y: u16); @@ -172,14 +172,14 @@ impl ApplyPartialWindow for AutomaticPartialWindow { display.write_data((vred & 0xFF) as u8); display.write_data(0x00); } - + fn update_partial_window(&mut self, min_x: u16, max_x: u16, min_y: u16, max_y: u16) { self.min_x = core::cmp::min(self.min_x, min_x); self.max_x = core::cmp::max(self.max_x, max_x); self.min_y = core::cmp::min(self.min_y, min_y); self.max_y = core::cmp::max(self.max_y, max_y); } - + fn reset_partial_window(&mut self) { *self = AutomaticPartialWindow { min_x: EPD_WIDTH as u16, @@ -292,12 +292,30 @@ impl