File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,8 @@ impl ClickTracker {
246246 return ClickCount :: Single ;
247247 } ;
248248
249- let previous = record. time ;
249+ let prev_time = record. time ;
250+ let prev_position = record. position ;
250251
251252 let now = Instant :: now ( ) ;
252253 record. time = now;
@@ -270,10 +271,10 @@ impl ClickTracker {
270271 _ => { }
271272 }
272273
273- let dx = position. x . abs_diff ( record . position . x ) ;
274- let dy = position. y . abs_diff ( record . position . y ) ;
274+ let dx = position. x . abs_diff ( prev_position . x ) ;
275+ let dy = position. y . abs_diff ( prev_position . y ) ;
275276 let within_dist = dx <= MULTICLICK_ALLOWED_TRAVEL && dy <= MULTICLICK_ALLOWED_TRAVEL ;
276- let within_time = now. saturating_duration_since ( previous ) <= MULTICLICK_TIMEOUT ;
277+ let within_time = now. saturating_duration_since ( prev_time ) <= MULTICLICK_TIMEOUT ;
277278
278279 let count = if within_time && within_dist { ClickCount :: Double } else { ClickCount :: Single } ;
279280
You can’t perform that action at this time.
0 commit comments