1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Add debug logging to help fix weird WSLg bug

This commit is contained in:
Emil Ernerfeldt
2022-12-14 14:22:09 +01:00
parent df9df39f10
commit 739d918e92
2 changed files with 15 additions and 0 deletions

View File

@@ -62,6 +62,12 @@ impl WindowSettings {
}
if let Some(inner_size_points) = self.inner_size_points {
tracing::info!(
"Restoring window size to {}x{} points, with fullscreen={}",
inner_size_points.x,
inner_size_points.y,
self.fullscreen
);
window
.with_inner_size(winit::dpi::LogicalSize {
width: inner_size_points.x as f64,
@@ -80,6 +86,8 @@ impl WindowSettings {
use egui::NumExt as _;
if let Some(size) = &mut self.inner_size_points {
tracing::info!("Clamping size to {}x{} points", max_size.x, max_size.y);
// Prevent ridiculously small windows
let min_size = egui::Vec2::splat(64.0);
*size = size.at_least(min_size);