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

Revert "Workaround for egui having wrong scale in firefox" #5481

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions crates/eframe/src/web/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,15 +870,7 @@ fn get_display_size(resize_observer_entries: &js_sys::Array) -> Result<(u32, u32
let mut dpr = web_sys::window().unwrap().device_pixel_ratio();

let entry: web_sys::ResizeObserverEntry = resize_observer_entries.at(0).dyn_into()?;
// TODO(lucasmerlin): This is disabled because of https://github.com/emilk/egui/issues/5246
// Not only does it break on chrome when moving the window across screens, but it also
// completely breaks in firefox because for some reason firefox reports the devicePixelRatio
// as 2.0 when it should be 1.0.
// The proper fix would probably be to calculate the correct device pixel ratio based on
// the inline_size and the content_rect.width, and use that
// wherever we access window.devicePixelRatio
#[allow(clippy::overly_complex_bool_expr)]
if JsValue::from_str("devicePixelContentBoxSize").js_in(entry.as_ref()) && false {
if JsValue::from_str("devicePixelContentBoxSize").js_in(entry.as_ref()) {
// NOTE: Only this path gives the correct answer for most browsers.
// Unfortunately this doesn't work perfectly everywhere.
let size: web_sys::ResizeObserverSize =
Expand Down
Loading