From f96caeb4193971a7541930a6ed579d776bd9fc3c Mon Sep 17 00:00:00 2001 From: dbr Date: Sun, 11 Aug 2019 11:01:12 +0930 Subject: [PATCH 1/6] Update for embedded-graphics 0.5.2 --- Cargo.toml | 2 +- src/epd4in2/graphics.rs | 4 ++-- src/graphics.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2dde4d6..b8864fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ type_a_alternative_faster_lut = [] [dependencies.embedded-graphics] optional = true -version = "0.4.3" +version = "0.5.2" [dependencies.embedded-hal] features = ["unproven"] diff --git a/src/epd4in2/graphics.rs b/src/epd4in2/graphics.rs index 38ddd89..83f5459 100644 --- a/src/epd4in2/graphics.rs +++ b/src/epd4in2/graphics.rs @@ -25,9 +25,9 @@ impl Default for Display4in2 { impl Drawing for Display4in2 { fn draw(&mut self, item_pixels: T) where - T: Iterator>, + T: IntoIterator>, { - self.draw_helper(WIDTH, HEIGHT, item_pixels); + self.draw_helper(WIDTH, HEIGHT, item_pixels.into_iter()); } } diff --git a/src/graphics.rs b/src/graphics.rs index 3b8076e..437abcd 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -122,9 +122,9 @@ impl<'a> VarDisplay<'a> { impl<'a> Drawing for VarDisplay<'a> { fn draw(&mut self, item_pixels: T) where - T: Iterator>, + T: IntoIterator>, { - self.draw_helper(self.width, self.height, item_pixels); + self.draw_helper(self.width, self.height, item_pixels.into_iter()); } } From 99b4cff362c662264d0165401ec202ae4bd6d0ff Mon Sep 17 00:00:00 2001 From: dbr Date: Fri, 16 Aug 2019 23:59:58 +0930 Subject: [PATCH 2/6] draw_helper takes IntoIterator Update other display types --- src/epd1in54/graphics.rs | 2 +- src/epd2in9/graphics.rs | 2 +- src/epd4in2/graphics.rs | 2 +- src/graphics.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/epd1in54/graphics.rs b/src/epd1in54/graphics.rs index 7206b10..a0114a0 100644 --- a/src/epd1in54/graphics.rs +++ b/src/epd1in54/graphics.rs @@ -25,7 +25,7 @@ impl Default for Display1in54 { impl Drawing for Display1in54 { fn draw(&mut self, item_pixels: T) where - T: Iterator>, + T: IntoIterator>, { self.draw_helper(WIDTH, HEIGHT, item_pixels); } diff --git a/src/epd2in9/graphics.rs b/src/epd2in9/graphics.rs index 816087c..d9b723c 100644 --- a/src/epd2in9/graphics.rs +++ b/src/epd2in9/graphics.rs @@ -25,7 +25,7 @@ impl Default for Display2in9 { impl Drawing for Display2in9 { fn draw(&mut self, item_pixels: T) where - T: Iterator>, + T: IntoIterator>, { self.draw_helper(WIDTH, HEIGHT, item_pixels); } diff --git a/src/epd4in2/graphics.rs b/src/epd4in2/graphics.rs index 83f5459..1993590 100644 --- a/src/epd4in2/graphics.rs +++ b/src/epd4in2/graphics.rs @@ -27,7 +27,7 @@ impl Drawing for Display4in2 { where T: IntoIterator>, { - self.draw_helper(WIDTH, HEIGHT, item_pixels.into_iter()); + self.draw_helper(WIDTH, HEIGHT, item_pixels); } } diff --git a/src/graphics.rs b/src/graphics.rs index 437abcd..a801096 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -47,7 +47,7 @@ pub trait Display: Drawing { /// Becomes uneccesary when const_generics become stablised fn draw_helper(&mut self, width: u32, height: u32, item_pixels: T) where - T: Iterator>, + T: IntoIterator>, { let rotation = self.rotation(); let buffer = self.get_mut_buffer(); @@ -124,7 +124,7 @@ impl<'a> Drawing for VarDisplay<'a> { where T: IntoIterator>, { - self.draw_helper(self.width, self.height, item_pixels.into_iter()); + self.draw_helper(self.width, self.height, item_pixels); } } From 3e56353cb6b2ea03bd7cfb7e5cdeda06580bb054 Mon Sep 17 00:00:00 2001 From: dbr Date: Sat, 17 Aug 2019 09:31:58 +0930 Subject: [PATCH 3/6] embedded-graphics 0.5.0 removed the with_ prefix from some methods with_stroke() to stroke() with_fill() to fill() with_style() to style() --- README.md | 4 +-- examples/epd1in54_full/src/main.rs | 18 ++++++------ examples/epd2in9_full/src/main.rs | 18 ++++++------ examples/epd4in2_full/src/main.rs | 28 +++++++++---------- examples/epd4in2_full_blue_pill/src/main.rs | 28 +++++++++---------- .../epd4in2_var_display_buffer/src/main.rs | 28 +++++++++---------- src/epd1in54/graphics.rs | 8 +++--- src/epd1in54/mod.rs | 4 +-- src/epd2in9/mod.rs | 4 +-- src/epd4in2/graphics.rs | 8 +++--- src/graphics.rs | 6 ++-- src/lib.rs | 4 +-- 12 files changed, 79 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 9b0c441..e458704 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ let mut display = Display::new(epd.width(), epd.height(), &mut buffer.buffer); // Draw some text display.draw( Font12x16::render_str("Hello Rust!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); diff --git a/examples/epd1in54_full/src/main.rs b/examples/epd1in54_full/src/main.rs index 81e7be2..a308905 100644 --- a/examples/epd1in54_full/src/main.rs +++ b/examples/epd1in54_full/src/main.rs @@ -80,8 +80,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate0); display.draw( Font6x8::render_str("Rotate 0!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -89,8 +89,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate90); display.draw( Font6x8::render_str("Rotate 90!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -98,8 +98,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate180); display.draw( Font6x8::render_str("Rotate 180!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -107,8 +107,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate270); display.draw( Font6x8::render_str("Rotate 270!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -129,7 +129,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font6x8::render_str(" Hello World! ") - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts diff --git a/examples/epd2in9_full/src/main.rs b/examples/epd2in9_full/src/main.rs index b3dfd3a..e4e25a0 100644 --- a/examples/epd2in9_full/src/main.rs +++ b/examples/epd2in9_full/src/main.rs @@ -84,8 +84,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate0); display.draw( Font6x8::render_str("Rotate 0!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -93,8 +93,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate90); display.draw( Font6x8::render_str("Rotate 90!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -102,8 +102,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate180); display.draw( Font6x8::render_str("Rotate 180!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -111,8 +111,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate270); display.draw( Font6x8::render_str("Rotate 270!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -133,7 +133,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font6x8::render_str(" Hello World! ") - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts diff --git a/examples/epd4in2_full/src/main.rs b/examples/epd4in2_full/src/main.rs index 2e903dd..b333b23 100644 --- a/examples/epd4in2_full/src/main.rs +++ b/examples/epd4in2_full/src/main.rs @@ -75,8 +75,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate0); display.draw( Font6x8::render_str("Rotate 0!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -84,8 +84,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate90); display.draw( Font6x8::render_str("Rotate 90!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -93,8 +93,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate180); display.draw( Font6x8::render_str("Rotate 180!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -102,8 +102,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate270); display.draw( Font6x8::render_str("Rotate 270!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -120,17 +120,17 @@ fn run() -> Result<(), std::io::Error> { // draw a analog clock display.draw( Circle::new(Coord::new(64, 64), 64) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); display.draw( Line::new(Coord::new(64, 64), Coord::new(0, 64)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); display.draw( Line::new(Coord::new(64, 64), Coord::new(80, 80)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -138,7 +138,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font6x8::render_str("It's working-WoB!") // Using Style here - .with_style(Style { + .style(Style { fill_color: Some(Color::Black), stroke_color: Some(Color::White), stroke_width: 0u8, // Has no effect on fonts @@ -151,7 +151,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font12x16::render_str("It's working-BoW!") // Using Style here - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts @@ -167,7 +167,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font6x8::render_str(" Hello World! ") - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts diff --git a/examples/epd4in2_full_blue_pill/src/main.rs b/examples/epd4in2_full_blue_pill/src/main.rs index f37c0dd..a20143b 100644 --- a/examples/epd4in2_full_blue_pill/src/main.rs +++ b/examples/epd4in2_full_blue_pill/src/main.rs @@ -71,8 +71,8 @@ fn main() -> ! { display.set_rotation(DisplayRotation::Rotate0); display.draw( Font6x8::render_str("Rotate 0!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -80,8 +80,8 @@ fn main() -> ! { display.set_rotation(DisplayRotation::Rotate90); display.draw( Font6x8::render_str("Rotate 90!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -89,8 +89,8 @@ fn main() -> ! { display.set_rotation(DisplayRotation::Rotate180); display.draw( Font6x8::render_str("Rotate 180!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -98,8 +98,8 @@ fn main() -> ! { display.set_rotation(DisplayRotation::Rotate270); display.draw( Font6x8::render_str("Rotate 270!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -116,17 +116,17 @@ fn main() -> ! { // draw a analog clock display.draw( Circle::new(Coord::new(64, 64), 64) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); display.draw( Line::new(Coord::new(64, 64), Coord::new(0, 64)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); display.draw( Line::new(Coord::new(64, 64), Coord::new(80, 80)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -134,7 +134,7 @@ fn main() -> ! { display.draw( Font6x8::render_str("It's working-WoB!") // Using Style here - .with_style(Style { + .style(Style { fill_color: Some(Color::Black), stroke_color: Some(Color::White), stroke_width: 0u8, // Has no effect on fonts @@ -147,7 +147,7 @@ fn main() -> ! { display.draw( Font12x16::render_str("It's working-BoW!") // Using Style here - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts @@ -165,7 +165,7 @@ fn main() -> ! { display.draw( Font6x8::render_str(" Hello World! ") - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts diff --git a/examples/epd4in2_var_display_buffer/src/main.rs b/examples/epd4in2_var_display_buffer/src/main.rs index fa421a1..f15ab4b 100644 --- a/examples/epd4in2_var_display_buffer/src/main.rs +++ b/examples/epd4in2_var_display_buffer/src/main.rs @@ -79,8 +79,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate0); display.draw( Font6x8::render_str("Rotate 0!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -88,8 +88,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate90); display.draw( Font6x8::render_str("Rotate 90!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -97,8 +97,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate180); display.draw( Font6x8::render_str("Rotate 180!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -106,8 +106,8 @@ fn run() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate270); display.draw( Font6x8::render_str("Rotate 270!") - .with_stroke(Some(Color::Black)) - .with_fill(Some(Color::White)) + .stroke(Some(Color::Black)) + .fill(Some(Color::White)) .translate(Coord::new(5, 50)) .into_iter(), ); @@ -126,17 +126,17 @@ fn run() -> Result<(), std::io::Error> { // draw a analog clock display.draw( Circle::new(Coord::new(64, 64), 64) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); display.draw( Line::new(Coord::new(64, 64), Coord::new(0, 64)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); display.draw( Line::new(Coord::new(64, 64), Coord::new(80, 80)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -144,7 +144,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font6x8::render_str("It's working-WoB!") // Using Style here - .with_style(Style { + .style(Style { fill_color: Some(Color::Black), stroke_color: Some(Color::White), stroke_width: 0u8, // Has no effect on fonts @@ -157,7 +157,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font12x16::render_str("It's working-BoW!") // Using Style here - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts @@ -173,7 +173,7 @@ fn run() -> Result<(), std::io::Error> { display.draw( Font6x8::render_str(" Hello World! ") - .with_style(Style { + .style(Style { fill_color: Some(Color::White), stroke_color: Some(Color::Black), stroke_width: 0u8, // Has no effect on fonts diff --git a/src/epd1in54/graphics.rs b/src/epd1in54/graphics.rs index a0114a0..b63c460 100644 --- a/src/epd1in54/graphics.rs +++ b/src/epd1in54/graphics.rs @@ -78,7 +78,7 @@ mod tests { let mut display = Display1in54::default(); display.draw( Line::new(Coord::new(0, 0), Coord::new(7, 0)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -97,7 +97,7 @@ mod tests { display.set_rotation(DisplayRotation::Rotate90); display.draw( Line::new(Coord::new(0, 192), Coord::new(0, 199)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -116,7 +116,7 @@ mod tests { display.set_rotation(DisplayRotation::Rotate180); display.draw( Line::new(Coord::new(192, 199), Coord::new(199, 199)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -138,7 +138,7 @@ mod tests { display.set_rotation(DisplayRotation::Rotate270); display.draw( Line::new(Coord::new(199, 0), Coord::new(199, 7)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); diff --git a/src/epd1in54/mod.rs b/src/epd1in54/mod.rs index e666a45..e262f08 100644 --- a/src/epd1in54/mod.rs +++ b/src/epd1in54/mod.rs @@ -19,8 +19,8 @@ //! // Write some hello world in the screenbuffer //! display.draw( //! Font6x8::render_str("Hello World!") -//! .with_stroke(Some(Color::Black)) -//! .with_fill(Some(Color::White)) +//! .stroke(Some(Color::Black)) +//! .fill(Some(Color::White)) //! .translate(Coord::new(5, 50)) //! .into_iter(), //! ); diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index a10a152..4bb8d5a 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -21,8 +21,8 @@ //! // Write some hello world in the screenbuffer //! display.draw( //! Font6x8::render_str("Hello World!") -//! .with_stroke(Some(Color::Black)) -//! .with_fill(Some(Color::White)) +//! .stroke(Some(Color::Black)) +//! .fill(Some(Color::White)) //! .translate(Coord::new(5, 50)) //! .into_iter(), //! ); diff --git a/src/epd4in2/graphics.rs b/src/epd4in2/graphics.rs index 1993590..41332ab 100644 --- a/src/epd4in2/graphics.rs +++ b/src/epd4in2/graphics.rs @@ -79,7 +79,7 @@ mod tests { let mut display = Display4in2::default(); display.draw( Line::new(Coord::new(0, 0), Coord::new(7, 0)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -98,7 +98,7 @@ mod tests { display.set_rotation(DisplayRotation::Rotate90); display.draw( Line::new(Coord::new(0, 392), Coord::new(0, 399)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -117,7 +117,7 @@ mod tests { display.set_rotation(DisplayRotation::Rotate180); display.draw( Line::new(Coord::new(392, 299), Coord::new(399, 299)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -139,7 +139,7 @@ mod tests { display.set_rotation(DisplayRotation::Rotate270); display.draw( Line::new(Coord::new(299, 0), Coord::new(299, 7)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); diff --git a/src/graphics.rs b/src/graphics.rs index a801096..d01ecb7 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -95,7 +95,7 @@ pub trait Display: Drawing { /// /// display.draw( /// Line::new(Coord::new(0, 120), Coord::new(0, 295)) -/// .with_stroke(Some(Color::Black)) +/// .stroke(Some(Color::Black)) /// .into_iter(), /// ); /// ``` @@ -249,7 +249,7 @@ mod tests { display.draw( Line::new(Coord::new(0, 0), Coord::new(7, 0)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); @@ -275,7 +275,7 @@ mod tests { display.draw( Line::new(Coord::new(0, 120), Coord::new(0, 295)) - .with_stroke(Some(Color::Black)) + .stroke(Some(Color::Black)) .into_iter(), ); diff --git a/src/lib.rs b/src/lib.rs index f2dd16f..dffacde 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,8 +37,8 @@ //! // Write some hello world in the screenbuffer //! display.draw( //! Font6x8::render_str("Hello World!") -//! .with_stroke(Some(Color::Black)) -//! .with_fill(Some(Color::White)) +//! .stroke(Some(Color::Black)) +//! .fill(Some(Color::White)) //! .translate(Coord::new(5, 50)) //! .into_iter(), //! ); From 0b047b211b0168484facd84b99ca9cc52de52132 Mon Sep 17 00:00:00 2001 From: dbr Date: Sun, 18 Aug 2019 17:54:35 +0930 Subject: [PATCH 4/6] Trivial tidyup --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index e458704..9c5fe4c 100644 --- a/README.md +++ b/README.md @@ -91,10 +91,3 @@ They are also called A and B, but you shouldn't get confused and mix it with the | | 7.5in (A) | | | 7.5in (B) | | | 7.5in (C) | - - - - - - - From 044c798a8b1e2ba13d6078315d7035602c2dd844 Mon Sep 17 00:00:00 2001 From: dbr Date: Sun, 18 Aug 2019 17:58:48 +0930 Subject: [PATCH 5/6] Update examples to embedded-graphics="0.5.2" also --- examples/epd1in54_full/Cargo.toml | 2 +- examples/epd1in54_no_graphics/Cargo.toml | 2 +- examples/epd2in9_full/Cargo.toml | 2 +- examples/epd4in2_full/Cargo.toml | 2 +- examples/epd4in2_full_blue_pill/Cargo.toml | 2 +- examples/epd4in2_var_display_buffer/Cargo.toml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/epd1in54_full/Cargo.toml b/examples/epd1in54_full/Cargo.toml index c6d89d4..d900b46 100644 --- a/examples/epd1in54_full/Cargo.toml +++ b/examples/epd1in54_full/Cargo.toml @@ -9,5 +9,5 @@ edition = "2018" epd-waveshare = { path = "../../", default-features = false, features = ["epd1in54", "graphics"]} linux-embedded-hal = "0.2.2" -embedded-graphics = "0.4.5" +embedded-graphics = "0.5.2" embedded-hal = { version = "0.2.2", features = ["unproven"] } diff --git a/examples/epd1in54_no_graphics/Cargo.toml b/examples/epd1in54_no_graphics/Cargo.toml index 3868a67..10887fb 100644 --- a/examples/epd1in54_no_graphics/Cargo.toml +++ b/examples/epd1in54_no_graphics/Cargo.toml @@ -8,5 +8,5 @@ edition = "2018" epd-waveshare = { path = "../../", default-features = false, features = ["epd1in54"]} -linux-embedded-hal = "0.2.2" +linux-embedded-hal = "0.5.2" embedded-hal = { version = "0.2.2", features = ["unproven"] } diff --git a/examples/epd2in9_full/Cargo.toml b/examples/epd2in9_full/Cargo.toml index b7da641..da71ecb 100644 --- a/examples/epd2in9_full/Cargo.toml +++ b/examples/epd2in9_full/Cargo.toml @@ -9,5 +9,5 @@ edition = "2018" epd-waveshare = { path = "../../", default-features = false, features = ["epd2in9", "graphics"]} linux-embedded-hal = "0.2.2" -embedded-graphics = "0.4.5" +embedded-graphics = "0.5.2" embedded-hal = { version = "0.2.2", features = ["unproven"] } diff --git a/examples/epd4in2_full/Cargo.toml b/examples/epd4in2_full/Cargo.toml index 59f3a0d..c8b1068 100644 --- a/examples/epd4in2_full/Cargo.toml +++ b/examples/epd4in2_full/Cargo.toml @@ -11,5 +11,5 @@ edition = "2018" epd-waveshare = { path = "../../", default-features = false, features = ["epd4in2", "graphics"]} linux-embedded-hal = "0.2.2" -embedded-graphics = "0.4.5" +embedded-graphics = "0.5.2" embedded-hal = { version = "0.2.2", features = ["unproven"] } diff --git a/examples/epd4in2_full_blue_pill/Cargo.toml b/examples/epd4in2_full_blue_pill/Cargo.toml index b65e71a..b4abfbb 100644 --- a/examples/epd4in2_full_blue_pill/Cargo.toml +++ b/examples/epd4in2_full_blue_pill/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" #epd_waveshare = { path = "../../"} epd-waveshare = { path = "../../", default-features = false, features = ["epd4in2", "graphics"]} -embedded-graphics = "0.4.5" +embedded-graphics = "0.5.2" embedded-hal = { version = "0.2.2", features = ["unproven"] } stm32f1xx-hal = { version = "0.2", features = ["rt", "stm32f103" ] } diff --git a/examples/epd4in2_var_display_buffer/Cargo.toml b/examples/epd4in2_var_display_buffer/Cargo.toml index 59f3a0d..c8b1068 100644 --- a/examples/epd4in2_var_display_buffer/Cargo.toml +++ b/examples/epd4in2_var_display_buffer/Cargo.toml @@ -11,5 +11,5 @@ edition = "2018" epd-waveshare = { path = "../../", default-features = false, features = ["epd4in2", "graphics"]} linux-embedded-hal = "0.2.2" -embedded-graphics = "0.4.5" +embedded-graphics = "0.5.2" embedded-hal = { version = "0.2.2", features = ["unproven"] } From 3d05130bc030240157d02710a89af8cdc0894f10 Mon Sep 17 00:00:00 2001 From: dbr Date: Wed, 21 Aug 2019 21:41:46 +0930 Subject: [PATCH 6/6] Fix copypaste error --- examples/epd1in54_no_graphics/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/epd1in54_no_graphics/Cargo.toml b/examples/epd1in54_no_graphics/Cargo.toml index 10887fb..3868a67 100644 --- a/examples/epd1in54_no_graphics/Cargo.toml +++ b/examples/epd1in54_no_graphics/Cargo.toml @@ -8,5 +8,5 @@ edition = "2018" epd-waveshare = { path = "../../", default-features = false, features = ["epd1in54"]} -linux-embedded-hal = "0.5.2" +linux-embedded-hal = "0.2.2" embedded-hal = { version = "0.2.2", features = ["unproven"] }