Skip to content

Commit

Permalink
Disable problematic debug assert (rust-windowing#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeng2 authored May 24, 2024
1 parent 1813f60 commit 84fd25b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/platform_impl/web/web_sys/media_query_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ impl MediaQueryListHandle {
Self { mql, closure }
}

#[allow(dead_code)]
pub fn mql(&self) -> &MediaQueryList {
&self.mql
}
Expand Down
13 changes: 8 additions & 5 deletions src/platform_impl/web/web_sys/resize_scaling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ impl ResizeScaleInternal {
(-webkit-device-pixel-ratio: {current_scale})",
);
let mql = MediaQueryListHandle::new(window, &media_query, closure);
debug_assert!(
mql.mql().matches(),
"created media query doesn't match, {current_scale} != {}",
super::scale_factor(window)
);
// TODO(PLAT-806): There's a winit/browser bug that causes this debug_assert
// to trigger when the print dialog is open. To prevent debug builds from
// panicking, we disable the debug_assert for now.
// debug_assert!(
// mql.mql().matches(),
// "created media query doesn't match, {current_scale} != {}",
// super::scale_factor(window)
// );
mql
}

Expand Down

0 comments on commit 84fd25b

Please sign in to comment.