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

minimal-egui example has Pixels output covered by top file menu bar #290

Open
RobDavenport opened this issue Jul 22, 2022 · 2 comments
Open
Labels
question Usability question

Comments

@RobDavenport
Copy link

Hi!

I'm also running into this issue in my own project but noticed it's also happening in the example.

If you run the example, and stretch the window vertically, you will notice that a small part at the top of the pixels view is obstructed by the top menu bar. See attached examples:

image

Notice the bottom corners show black space, but the top corners are behind the menu bar.

And if we continue stretching vertically...

image

How can we fix this issue?

@parasyte
Copy link
Owner

parasyte commented Jul 23, 2022

There’s some discussion in #275 and #268 that is probably helpful. The short answer is that you can use the scaled texture as an egui image and place it into your GUI without any overlap. It’s a tradeoff that gives you more control but it requires more finesse and precision to use well.

@parasyte parasyte added the question Usability question label Jul 25, 2022
@dbalsom
Copy link

dbalsom commented Dec 2, 2023

My suggestion would be to have Pixels take margins or a rect (or both) representing the destination extents for the display surface. These could be passed in to ScalingMatrix::new() and the appropriate calculations made. If we could specify a rect in logical coordinates (0,1) it could be automatically adjusted as the window is resized.

This has a number of uses - egui's menu bar may not be the only UI element we want to dodge, and we may not even be using egui. It also allows interesting effects, like bezel overlays for an emulator (this requires a ScalingRenderer implementation)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question
Projects
None yet
Development

No branches or pull requests

3 participants