Skip to content

Commit 753057d

Browse files
timon-schellingKeavon
authored andcommitted
Improve readability
1 parent b46a26c commit 753057d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

desktop/src/cef/input/state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ impl ClickTracker {
149149
ElementState::Released => (record.up_count, record.up_position),
150150
};
151151

152-
let within_dist = position.x.abs_diff(prev_position.x) <= MULTICLICK_ALLOWED_TRAVEL && position.y.abs_diff(prev_position.y) <= MULTICLICK_ALLOWED_TRAVEL;
152+
let dx = position.x.abs_diff(prev_position.x);
153+
let dy = position.y.abs_diff(prev_position.y);
154+
let within_dist = dx <= MULTICLICK_ALLOWED_TRAVEL && dy <= MULTICLICK_ALLOWED_TRAVEL;
153155

154156
let count = match (prev_count, within_time, within_dist) {
155157
(ClickCount::Single, true, true) => ClickCount::Double,

0 commit comments

Comments
 (0)