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

Some widgets keep expanding due to non-integral pixels_per_point #27

Closed
hasenbanck opened this issue Oct 12, 2020 · 3 comments
Closed
Labels
bug Something is broken

Comments

@hasenbanck
Copy link
Contributor

Hi,

While testing the WGPU render backend and Winit platform crates I created, I get following odd error:

grafik

Some elments keep expanding once they are visible. In the screenshot you can see that the drawing area of the painting widget expands and keeps expanding. If you scroll down until the end of the drawing area is visible, the expanding will stop.

Anothe example:
grafik

Do you maybe know where I could start debugging this? I have a hard time figuring out how the backend or the windowing integration could cause this behavior.

The code for reproducing this problem can be found here can be found in this example project.

@emilk
Copy link
Owner

emilk commented Oct 12, 2020

I've had those bugs before, but fixed them, so weird seeing them pop up again! Interestingly, when I run your code it all works as expected.

What is the pixels_per_point (window.scale_factor()) on your system when you run your example? Maybe Egui has a rounding error for when pixels_per_point is non-integral.

Does demo_glium work as expected? How about https://emilk.github.io/egui/ ?

@hasenbanck
Copy link
Contributor Author

hasenbanck commented Oct 12, 2020

I run my desktop in 4k with 150% scale. So pixels_per_point is 1.5.

I can reproduce the same error with the glium backend, but it only triggers when I move the mouse, since the application doesn't run unlimited (ControlFlow::Poll) and waits for events (ControlFlow::Wait).

@emilk
Copy link
Owner

emilk commented Oct 12, 2020

Then it is probably a bug for me to fix in Egui. I'll try to get to it some time this week (or more likely: weekend)

@emilk emilk added the bug Something is broken label Oct 12, 2020
@emilk emilk changed the title Some DemoWindow elements keep expanding Some widgets keep expanding due to non-integral pixels_per_point Oct 12, 2020
@emilk emilk closed this as completed in b8642b4 Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants