1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

Control the maximum egui web canvas size with App::max_size_points

This commit is contained in:
Emil Ernerfeldt
2021-02-12 17:57:53 +01:00
parent be8d7b4eef
commit dbc6a620cd
6 changed files with 50 additions and 5 deletions

View File

@@ -97,6 +97,12 @@ pub trait App {
true
}
/// The size limit of the web app canvas
fn max_size_points(&self) -> egui::Vec2 {
// Some browsers get slow with huge WebGL canvases, so we limit the size:
egui::Vec2::new(1024.0, 2048.0)
}
/// Background color for the app, e.g. what is sent to `gl.clearColor`.
/// This is the background of your windows if you don't set a central panel.
fn clear_color(&self) -> egui::Rgba {