Skip to content

Commit

Permalink
Merge pull request rust-windowing#336 from Veedrac/hidpi_fix
Browse files Browse the repository at this point in the history
Fix non-integer HiDPI support in demo
  • Loading branch information
pcwalton authored May 11, 2020
2 parents 5ed2681 + faea46b commit cbceee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ impl<W> DemoApp<W> where W: Window {
}

fn process_mouse_position(&mut self, new_position: Vector2I) -> MousePosition {
let absolute = new_position * self.window_size.backing_scale_factor as i32;
let absolute = (new_position.to_f32() * self.window_size.backing_scale_factor).to_i32();
let relative = absolute - self.last_mouse_position;
self.last_mouse_position = absolute;
MousePosition { absolute, relative }
Expand Down

0 comments on commit cbceee8

Please sign in to comment.