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

Fix blurry egui #1266

Merged
merged 6 commits into from
Oct 25, 2022
Merged

Fix blurry egui #1266

merged 6 commits into from
Oct 25, 2022

Conversation

erenoku
Copy link
Contributor

@erenoku erenoku commented Oct 24, 2022

The egui context created here: https://github.com/hannobraun/Fornjot/blob/8c423093840ac7bb99b56533cb8b5804d43a3836/crates/fj-viewer/src/gui.rs#L52 for some reason didn't have the right pixels_per_point ratio so I explicitly set this ratio with the value I got from winit. This solved the blurriness but unfortunately the mouse input is still offseted.

@erenoku erenoku requested a review from hannobraun as a code owner October 24, 2022 17:21
hannobraun
hannobraun previously approved these changes Oct 25, 2022
Copy link
Owner

@hannobraun hannobraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @erenoku, this is awesome! I had already searched for something like this, but somehow I've missed it.

Your discovery inspired me to search again, and it turns out that egui-winit has a similar method, and calling that with the right value fixes the input too! I've pushed some additional commits to do that.

While I was at it, I also moved the call to set_pixels_per_point to the update method. This won't make a difference in most cases, but it doesn't seem to hurt and seems more robust.

Thanks again! Always nice to get a second set of eyes on these kinds of things. It's so easy to miss things, when you're working by yourself most of the time.

erenoku and others added 6 commits October 25, 2022 09:46
This value changing during the runtime of the program is probably a rare
edge case, but still, it's worth to support. In any case, doing it this
way doesn't seem to hurt.
@hannobraun hannobraun enabled auto-merge October 25, 2022 07:47
@hannobraun hannobraun merged commit 668e79d into hannobraun:main Oct 25, 2022
@erenoku erenoku deleted the fix_blurry_egui branch October 25, 2022 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants