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

Improve documentation and logging

This commit is contained in:
Emil Ernerfeldt
2022-08-20 15:06:43 +02:00
parent 725aa5277b
commit 8737933101
5 changed files with 11 additions and 4 deletions

View File

@@ -108,6 +108,10 @@ pub fn resize_canvas_to_screen_size(canvas_id: &str, max_size_points: egui::Vec2
y: height as f32,
};
if width <= 0 || height <= 0 {
tracing::error!("egui canvas parent size is {}x{}. Try adding `html, body {{ height: 100%; width: 100% }}` to your CSS!", width, height);
}
let pixels_per_point = native_pixels_per_point();
let max_size_pixels = pixels_per_point * max_size_points;