embedded-graphics 0.5.0 removed the with_ prefix from some methods

with_stroke() to stroke()
with_fill() to fill()
with_style() to style()
This commit is contained in:
dbr
2019-08-17 09:31:58 +09:30
parent 99b4cff362
commit 3e56353cb6
12 changed files with 79 additions and 79 deletions
+9 -9
View File
@@ -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
+9 -9
View File
@@ -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
+14 -14
View File
@@ -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
+14 -14
View File
@@ -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
+14 -14
View File
@@ -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