1
0
Fork 0

Allow releasing drags outside of slider area

This commit is contained in:
Robbert van der Helm 2022-03-14 16:21:52 +01:00
parent 9bfc44d787
commit 82c33da022

View file

@ -161,7 +161,7 @@ impl<'a, P: Param> Widget<ParamMessage, Renderer> for ParamSlider<'a, P> {
}
Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left))
| Event::Touch(touch::Event::FingerLifted { .. } | touch::Event::FingerLost { .. }) => {
if bounds.contains(cursor_position) {
if self.state.drag_active {
shell.publish(ParamMessage::EndSetParameter(self.param.as_ptr()));
self.state.drag_active = false;