Merge consecutive Mouse::Release instructions

This commit is contained in:
Héctor Ramón Jiménez 2025-06-13 15:48:24 +02:00
parent df3ca30660
commit baa7d2b96e
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F

View file

@ -127,6 +127,22 @@ impl Interaction {
None,
)
}
(
current @ Mouse::Release {
button: button_a,
at: at_a,
}
| current @ Mouse::Click {
button: button_a,
at: at_a,
},
Mouse::Release {
button: button_b,
at: at_b,
},
) if button_a == button_b && at_a == at_b => {
(Self::Mouse(current), None)
}
(current, next) => {
(Self::Mouse(current), Some(Self::Mouse(next)))
}