Do not capture released event inside image::Viewer

This commit is contained in:
rhysd 2025-01-23 22:16:11 +09:00 committed by Héctor Ramón Jiménez
parent 5195a59e20
commit 26e3b54c4f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -230,17 +230,12 @@ where
state.cursor_grabbed_at = Some(cursor_position);
state.starting_offset = state.current_offset;
shell.request_redraw();
shell.capture_event();
}
Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) => {
let state = tree.state.downcast_mut::<State>();
if state.cursor_grabbed_at.is_some() {
state.cursor_grabbed_at = None;
shell.request_redraw();
shell.capture_event();
}
state.cursor_grabbed_at = None;
}
Event::Mouse(mouse::Event::CursorMoved { position }) => {
let state = tree.state.downcast_mut::<State>();