1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 14:58:09 +00:00

fix(core/mercury): fix swipe effect duration when swipe is cancelled

This commit is contained in:
tychovrahe 2024-06-18 13:11:08 +02:00 committed by matejcik
parent 272b668feb
commit bfbcecc085

View File

@ -290,7 +290,7 @@ impl SwipeDetect {
if !animation_disabled() {
let done = self.moved as f32 / Self::PROGRESS_MAX as f32;
let ratio = 1.0 - done;
let ratio = if final_value == 0 { done } else { 1.0 - done };
let duration = config
.duration(locked)