Skip to content

Commit

Permalink
Request redraw in image viewer update
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah committed Feb 6, 2025
1 parent 4bbb5cb commit a8b1aef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions widget/src/image/viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ where
}
}

shell.request_redraw();
shell.capture_event();
}
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
Expand All @@ -226,13 +227,16 @@ 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();
}
}
Expand Down Expand Up @@ -273,6 +277,7 @@ where
};

state.current_offset = Vector::new(x, y);
shell.request_redraw();
shell.capture_event();
}
}
Expand Down

0 comments on commit a8b1aef

Please sign in to comment.