Skip to content

Commit 3ea1816

Browse files
committed
Report cursor position in logical pixels.
1 parent 84d6558 commit 3ea1816

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

  • crates/processing_glfw/src

crates/processing_glfw/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub struct GlfwContext {
1414
window: PWindow,
1515
events: GlfwReceiver<(f64, WindowEvent)>,
1616
surface: Option<Entity>,
17-
scale_factor: f32,
1817
}
1918

2019
impl GlfwContext {
@@ -31,14 +30,11 @@ impl GlfwContext {
3130
window.set_all_polling(true);
3231
window.show();
3332

34-
let (scale_factor, _) = window.get_content_scale();
35-
3633
Ok(Self {
3734
glfw,
3835
window,
3936
events,
4037
surface: None,
41-
scale_factor,
4238
})
4339
}
4440

@@ -127,8 +123,7 @@ impl GlfwContext {
127123
return false;
128124
}
129125
WindowEvent::CursorPos(x, y) => {
130-
let s = self.scale_factor;
131-
input_set_mouse_move(surface, x as f32 / s, y as f32 / s).unwrap();
126+
input_set_mouse_move(surface, x as f32, y as f32).unwrap();
132127
}
133128
WindowEvent::MouseButton(button, action, _mods) => {
134129
if let Some(btn) = glfw_button_to_bevy(button) {

0 commit comments

Comments
 (0)