File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::{
55use crate :: TIMEOUT_MS ;
66
77const INTERVAL_MS : i32 = TIMEOUT_MS * 1 ; // should be a multiple of TIMEOUT_MS
8- const PROLONGED_INTERVAL_MS : i32 = TIMEOUT_MS * 1 ; // should be a multiple of TIMEOUT_MS and more than INTERVAL_MS
8+ const PROLONGED_INTERVAL_MS : i32 = TIMEOUT_MS * 5 ; // should be a multiple of TIMEOUT_MS and more than INTERVAL_MS
99const ANIMATION_INTERVAL_MS : i32 = 200 ; // should be less than TIMEOUT_MS
1010const ANIMATION_DURATION_MS : i32 = 4000 ; // should be a multiple of ANIMATION_INTERVAL_MS
1111
@@ -73,7 +73,7 @@ impl PixelShiftManager {
7373 match self . state {
7474 ShiftState :: Normal => {
7575 self . state = ShiftState :: ShiftingSubpixel ;
76- self . subpixel_progress = self . direction as f64 ;
76+ self . subpixel_progress = if self . direction == 1 { 0.0 } else { 1.0 } ;
7777 } ,
7878 ShiftState :: ShiftingSubpixel => {
7979 let shift_by = ANIMATION_INTERVAL_MS as f64 / ANIMATION_DURATION_MS as f64 ;
You can’t perform that action at this time.
0 commit comments