From 81b4de369006513a1c95436a0735e80c9ccc19ec Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Wed, 15 Mar 2023 22:19:48 +0000 Subject: [PATCH] added more logs to test --- src/main.rs | 5 +++++ src/render.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 904c5d0..8f5874b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,6 +11,7 @@ mod utils; use animations::Animation; use r2d2::PooledConnection; use utils::ApiResponse; +use render::Lerp; use rocket::{State, serde::json::serde_json::json}; @@ -124,6 +125,10 @@ fn ligth_controll( render.remove_animation(ani.ok().unwrap()); } + println!("aaa"); + + println!("aaa {}", 0.lerp(&255)); + render.render(); } diff --git a/src/render.rs b/src/render.rs index eb7bd7d..2ae1784 100644 --- a/src/render.rs +++ b/src/render.rs @@ -298,13 +298,13 @@ impl Render { } } -trait Lerp { +pub trait Lerp { fn lerp(self, other: &Self) -> Self; } impl Lerp for u8 { fn lerp(self, other: &Self) -> Self { - ((self as f64) + (((*other as f64) - (self as f64)) * 0.2)) as u8 + ((self as f64) + (((*other as f64) - (self as f64)) * 0.1)) as u8 } }