Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View is shifted with non-integer display scaling factor #64

Open
TheKnightWhoSaysNi opened this issue Jan 1, 2025 · 1 comment
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@TheKnightWhoSaysNi
Copy link
Contributor

Hello, with non-integer screen scaling factors (mine is 150% in the attached screenshot) the pixels view does not originate from the top left corner so some screen real-estate is lost

I kind of fixed it by modifying the following snippet but it does not apply when resizing the window...

In event_loop.rs : L54
let (mut pixels, mut gui) = { let scale_factor = window.scale_factor(); let forced_scale_factor = if (scale_factor-scale_factor.floor()) > 0.5 { scale_factor.ceil() } else { scale_factor.floor() }; let window_size = LogicalSize::new(WIDTH, HEIGHT).to_physical(forced_scale_factor); window.set_inner_size(window_size); let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window); let pixels = Pixels::new(WIDTH, HEIGHT, surface_texture)?; let gui = Gui::new( &event_loop, window_size.width, window_size.height, scale_factor as f32, &pixels, ); (pixels, gui) };

Thanks for the great software !

image
@sharkdp sharkdp added bug Something isn't working help wanted Extra attention is needed labels Jan 4, 2025
@sharkdp
Copy link
Owner

sharkdp commented Jan 4, 2025

Thank you for reporting this. I can confirm that I see the same bug on my machine.

I currently don't have time to look into this, but would appreciate any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants