Skip to content

Commit 4633061

Browse files
Fix incorrect pixel color being published
1 parent 91aa1a3 commit 4633061

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/turtlesim_rs/src/turtle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ impl<'a> Turtle<'a> {
149149
let mut paint = Paint::default();
150150
paint.set_color_rgba8(
151151
DEFAULT_PEN_R,
152-
DEFAULT_PEN_B,
153152
DEFAULT_PEN_G,
153+
DEFAULT_PEN_B,
154154
DEFAULT_PEN_ALPHA,
155155
);
156156
paint.anti_alias = true;
@@ -255,7 +255,7 @@ impl<'a> Turtle<'a> {
255255

256256
let pixel_color = path_image.pixel(
257257
(self.pos.x * self.meter) as u32,
258-
((canvas_height - self.pos.y) * self.meter) as u32,
258+
(self.pos.y * self.meter) as u32,
259259
);
260260

261261
if let Some(color) = pixel_color {

0 commit comments

Comments
 (0)