Skip to content

Commit 7224c33

Browse files
committed
fix: stroke color
1 parent a822a98 commit 7224c33

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

src/main.rs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use embedded_graphics::fonts::Font6x8;
2+
use embedded_graphics::pixelcolor::BinaryColor;
23
use embedded_graphics::prelude::*;
34
use embedded_graphics::primitives::{Circle, Line, Rectangle};
45
use embedded_graphics::Drawing;
@@ -14,13 +15,33 @@ fn main() {
1415
disp.init().unwrap();
1516
disp.flush().unwrap();
1617

17-
disp.draw(Line::new(Point::new(8, 16 + 16), Point::new(8 + 16, 16 + 16)).into_iter());
18-
disp.draw(Line::new(Point::new(8, 16 + 16), Point::new(8 + 8, 16)).into_iter());
19-
disp.draw(Line::new(Point::new(8 + 16, 16 + 16), Point::new(8 + 8, 16)).into_iter());
18+
disp.draw(
19+
Line::new(Point::new(8, 16 + 16), Point::new(8 + 16, 16 + 16))
20+
.stroke(Some(BinaryColor::On))
21+
.into_iter(),
22+
);
23+
disp.draw(
24+
Line::new(Point::new(8, 16 + 16), Point::new(8 + 8, 16))
25+
.stroke(Some(BinaryColor::On))
26+
.into_iter(),
27+
);
28+
disp.draw(
29+
Line::new(Point::new(8 + 16, 16 + 16), Point::new(8 + 8, 16))
30+
.stroke(Some(BinaryColor::On))
31+
.into_iter(),
32+
);
2033

21-
disp.draw(Rectangle::new(Point::new(48, 16), Point::new(48 + 16, 16 + 16)).into_iter());
34+
disp.draw(
35+
Rectangle::new(Point::new(48, 16), Point::new(48 + 16, 16 + 16))
36+
.stroke(Some(BinaryColor::On))
37+
.into_iter(),
38+
);
2239

23-
disp.draw(Circle::new(Point::new(96, 16 + 8), 8).into_iter());
40+
disp.draw(
41+
Circle::new(Point::new(96, 16 + 8), 8)
42+
.stroke(Some(BinaryColor::On))
43+
.into_iter(),
44+
);
2445

2546
let local_addr = machine_ip::get().unwrap();
2647

0 commit comments

Comments
 (0)