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

Incorrect monitor resolution being reported by display-info crate #46

Open
THEGOLDENPRO opened this issue Dec 31, 2024 · 5 comments
Open

Comments

@THEGOLDENPRO
Copy link
Member

If you're on a laptop with a 1920x1080 display and it's scale factor is set to 125% like mine the incorrect width and height will be reported by display-info breaking the smart downsampling optimization in Roseate.

See nashaofu/display-info#38

@r3tr0ananas
Copy link
Member

egui has it's own "display-info" (it only returns the size of the display the app is on + you need access to a Context).

let monitor_size = ctx.input(|i| {
    let viewport = i.viewport();

    viewport.monitor_size
});

@THEGOLDENPRO
Copy link
Member Author

egui has it's own "display-info" (it only returns the size of the display the app is on + you need access to a Context).

let monitor_size = ctx.input(|i| {
    let viewport = i.viewport();

    viewport.monitor_size
});

WHAT! Did they add that recently or like in the last 2 major releases? That's literally all I need.

@r3tr0ananas
Copy link
Member

egui has it's own "display-info" (it only returns the size of the display the app is on + you need access to a Context).

let monitor_size = ctx.input(|i| {
    let viewport = i.viewport();

    viewport.monitor_size
});

WHAT! Did they add that recently or like in the last 2 major releases? That's literally all I need.

It existed since v0.24.0: https://docs.rs/egui/0.24.0/egui/struct.ViewportInfo.html

@THEGOLDENPRO
Copy link
Member Author

Now that I think of it I feel like I've tried this before and it didn't work or something, but I'll certainly try it again.

@THEGOLDENPRO
Copy link
Member Author

Yeah I wanna do a complete restructure of Image and ImageLoader before I pass ctx.

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

No branches or pull requests

2 participants