diff --git a/README.md b/README.md index c4345522..65c4678a 100644 --- a/README.md +++ b/README.md @@ -304,6 +304,9 @@ The _frame_ in `eframe` stands both for the frame in which your egui app resides ### Why is `egui_web` using so much CPU in Firefox? On Linux and Mac, Firefox will copy the WebGL render target from GPU, to CPU and then back again: https://bugzilla.mozilla.org/show_bug.cgi?id=1010527#c0 +### Why does my web app not fill the full width of the screen? +To alleviate the above mentioned performance issues the default max-width of an egui web app is 1024 points. You can change this by ovveriding the `fn max_size_points` of `epi::App`. + ## Other diff --git a/eframe/src/lib.rs b/eframe/src/lib.rs index 25d08e4b..71c9edfb 100644 --- a/eframe/src/lib.rs +++ b/eframe/src/lib.rs @@ -35,6 +35,10 @@ pub use egui_web::wasm_bindgen; /// Install event listeners to register different input events /// and start running the given app. /// +/// For performance reasons (on some browsers) the egui canvas does not, by default, +/// fill the whole width of the browser. +/// This can be changed by overriding [`epi::Frame::max_size_points`]. +/// /// Usage: /// ``` no_run /// #[cfg(target_arch = "wasm32")] diff --git a/egui_web/src/lib.rs b/egui_web/src/lib.rs index 9571f942..b939344a 100644 --- a/egui_web/src/lib.rs +++ b/egui_web/src/lib.rs @@ -3,6 +3,11 @@ //! This library is an [`epi`] backend. //! //! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead. +//! +//! ## Specifying the size of the egui canvas +//! For performance reasons (on some browsers) the egui canvas does not, by default, +//! fill the whole width of the browser. +//! This can be changed by overriding [`epi::App::max_size_points`]. #![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds #![deny(