fix: i in point for etherdream is meh

This commit is contained in:
alban 2023-07-24 17:35:39 +02:00
parent 514f4cc7c9
commit 22d7d3c718

View File

@ -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<Point> 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<Point> for DacPoint {
b: (pt.color.b as u16) * 255,
u1,
u2,
}
};
// debug!("point {:?}", pt);
pt
}
}