From 22d7d3c718c8db551871565f73ee9fdcdfa24aa6 Mon Sep 17 00:00:00 2001 From: alban Date: Mon, 24 Jul 2023 17:35:39 +0200 Subject: [PATCH] fix: i in point for etherdream is meh --- src/point.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/point.rs b/src/point.rs index 6ce6268..273bfbc 100644 --- a/src/point.rs +++ b/src/point.rs @@ -1,5 +1,6 @@ use ether_dream::protocol::DacPoint; + #[derive(Debug, Clone, Copy, Default, PartialEq)] pub struct Point { pub x: f32, @@ -48,10 +49,10 @@ impl From for DacPoint { fn from(pt: Point) -> DacPoint { let control = 0; let (u1, u2) = (0, 0); - let i = 255; + let i = 0; let x = pt.x.clamp(-32000.0, 32000.0); let y = pt.y.clamp(-32000.0, 32000.0); - DacPoint { + let pt = DacPoint { control, x: x as i16, y: y as i16, @@ -61,6 +62,8 @@ impl From for DacPoint { b: (pt.color.b as u16) * 255, u1, u2, - } + }; + // debug!("point {:?}", pt); + pt } }