From b07f4d938a734afafba591b9dec8ea92b348a351 Mon Sep 17 00:00:00 2001 From: grdddj Date: Fri, 22 Sep 2023 13:35:16 +0200 Subject: [PATCH] fix(core): make the marquee take always 2 seconds to animate from end to end [no changelog] --- core/embed/rust/src/ui/component/marquee.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/core/embed/rust/src/ui/component/marquee.rs b/core/embed/rust/src/ui/component/marquee.rs index 7748810944..c9bb1df426 100644 --- a/core/embed/rust/src/ui/component/marquee.rs +++ b/core/embed/rust/src/ui/component/marquee.rs @@ -10,7 +10,6 @@ use crate::{ }, }; -const MILLIS_PER_LETTER_M: u32 = 300; const ANIMATION_DURATION_MS: u32 = 2000; const PAUSE_DURATION_MS: u32 = 1000; @@ -141,22 +140,6 @@ where type Msg = Never; fn place(&mut self, bounds: Rect) -> Rect { - let base_width = self.font.text_width("M"); - let text_width = self.font.text_width(self.text.as_ref()); - let area_width = bounds.width(); - - let shift_width = if area_width > text_width { - area_width - text_width - } else { - text_width - area_width - }; - - let mut duration = (MILLIS_PER_LETTER_M * shift_width as u32) / base_width as u32; - if duration < MILLIS_PER_LETTER_M { - duration = MILLIS_PER_LETTER_M; - } - - self.duration = Duration::from_millis(duration); self.area = bounds; self.area }