egui_web: document how to fill the full width of the browser
This commit is contained in:
parent
2932ff0e53
commit
ec6268e4ac
3 changed files with 12 additions and 0 deletions
|
@ -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?
|
### 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
|
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
|
## Other
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@ pub use egui_web::wasm_bindgen;
|
||||||
/// Install event listeners to register different input events
|
/// Install event listeners to register different input events
|
||||||
/// and start running the given app.
|
/// 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:
|
/// Usage:
|
||||||
/// ``` no_run
|
/// ``` no_run
|
||||||
/// #[cfg(target_arch = "wasm32")]
|
/// #[cfg(target_arch = "wasm32")]
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
//! This library is an [`epi`] backend.
|
//! This library is an [`epi`] backend.
|
||||||
//!
|
//!
|
||||||
//! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead.
|
//! 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
|
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
|
||||||
#![deny(
|
#![deny(
|
||||||
|
|
Loading…
Reference in a new issue