You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems the mouse coordinates are off when you go into fullscreen mode on macOS (Ventura 13.1). It gets it right for any resized window and for any scale_mode, except when I go fullscreen the mouse is not where it thinks. This doesn't seem to affect Windows users.
Fullscreen:
Non fullscreen (regardless of scale mode, aspect ratio or size)
code:
use minifb::*;fnmain(){letmut window = Window::new("Fullscreen",800,500,WindowOptions{resize:true,scale_mode:ScaleMode::Center,
..WindowOptions::default()},).unwrap();while window.is_open() && !window.is_key_down(Key::Escape){assert_eq!(
window.get_mouse_pos(MouseMode::Discard),
window.get_unscaled_mouse_pos(MouseMode::Discard));let(width, height) = window.get_size();letmut pixels = vec![0x00000000; width * height];// Paint the row and col of pixels that the mouse is hovering over
window
.get_mouse_pos(MouseMode::Discard).map(|(mouse_x, mouse_y)| {for mouse_x in0..width {
pixels[mouse_x asusize + mouse_y asusize* width] = 0x00FFFFFF;}for mouse_y in0..height {
pixels[mouse_x asusize + mouse_y asusize* width] = 0x00FFFFFF;}});
window.update_with_buffer(&pixels, width, height).unwrap();}}
On a possibly unrelated note, should this work after resizing?
Thanks for the report. My guess is that minifb needs to detect when the application enters fullscreen as I think it currently always includes the size of the titlebar currently.
It seems the mouse coordinates are off when you go into fullscreen mode on macOS (Ventura 13.1). It gets it right for any resized window and for any scale_mode, except when I go fullscreen the mouse is not where it thinks. This doesn't seem to affect Windows users.
Fullscreen:
Non fullscreen (regardless of scale mode, aspect ratio or size)
code:
On a possibly unrelated note, should this work after resizing?
Thanks for your time
The text was updated successfully, but these errors were encountered: