Merge pull request #1898 from hannobraun/viewer

Fix mouse input
This commit is contained in:
Hanno Braun 2023-06-20 09:47:12 +02:00 committed by GitHub
commit d32c95762f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -36,8 +36,8 @@ impl Viewer {
}
/// Access the cursor
pub fn cursor(&self) -> Option<NormalizedScreenPosition> {
self.cursor
pub fn cursor(&mut self) -> &mut Option<NormalizedScreenPosition> {
&mut self.cursor
}
/// Toggle the "draw model" setting

View File

@ -32,7 +32,7 @@ pub fn display(model: Model, invert_zoom: bool) -> Result<(), Error> {
&event,
&window,
&held_mouse_button,
&mut viewer.cursor(),
viewer.cursor(),
invert_zoom,
);
if let Some(input_event) = input_event {