pixels icon indicating copy to clipboard operation
pixels copied to clipboard

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

Open RobDavenport opened this issue 3 years ago • 2 comments

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?

RobDavenport avatar Jul 22 '22 14:07 RobDavenport

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 avatar Jul 23 '22 04:07 parasyte

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

dbalsom avatar Dec 02 '23 18:12 dbalsom