Some minor docs improvements (#7614)

This commit is contained in:
Lucas Meurer 2025-10-09 12:00:39 +02:00 committed by GitHub
parent cfca7ebd6d
commit da39198142
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
//! Helpers for zooming the whole GUI of an app (changing [`Context::pixels_per_point`]. //! Helpers for zooming the whole GUI of an app (changing [`Context::pixels_per_point`]).
//! //!
use crate::{Button, Context, Key, KeyboardShortcut, Modifiers, Ui}; use crate::{Button, Context, Key, KeyboardShortcut, Modifiers, Ui};

View File

@ -50,8 +50,8 @@ This is so that you can set `UPDATE_SNAPSHOTS=true` and update all tests, withou
If you want to update all snapshot images, even those that are within error margins, If you want to update all snapshot images, even those that are within error margins,
run with `UPDATE_SNAPSHOTS=force`. run with `UPDATE_SNAPSHOTS=force`.
If you want to have multiple snapshots in the same test, it makes sense to collect the results in a `Vec` If you want to have multiple snapshots in the same test, it makes sense to collect the results in a `SnapshotResults`
([look here](https://github.com/emilk/egui/blob/70a01138b77f9c5724a35a6ef750b9ae1ab9f2dc/crates/egui_demo_lib/src/demo/demo_app_windows.rs#L388-L427) for an example). ([look here](https://github.com/emilk/egui/blob/d1fcd740ded5d69016c993a502b52e67f5d492d7/crates/egui_demo_lib/src/demo/demo_app_windows.rs#L387-L420) for an example).
This way they can all be updated at the same time. This way they can all be updated at the same time.
You should add the following to your `.gitignore`: You should add the following to your `.gitignore`:
@ -67,7 +67,7 @@ You should add the following to your `.gitignore`:
* …they are brittle since unrelated side effects (like a change in color) can cause the test to fail * …they are brittle since unrelated side effects (like a change in color) can cause the test to fail
* …images take up repo space * …images take up repo space
* images should… * images should…
* …be checked in or otherwise be available (egui use [git LFS](https://git-lfs.com/) files for this purpose) * …be checked in or otherwise be available (egui uses [git LFS](https://git-lfs.com/) files for this purpose)
* …depict exactly what's tested and nothing else * …depict exactly what's tested and nothing else
* …have a low resolution to avoid growth in repo size * …have a low resolution to avoid growth in repo size
* …have a low comparison threshold to avoid the test passing despite unwanted differences (the default threshold should be fine for most usecases!) * …have a low comparison threshold to avoid the test passing despite unwanted differences (the default threshold should be fine for most usecases!)

View File

@ -52,6 +52,7 @@ impl Display for ExceededMaxStepsError {
} }
/// The test Harness. This contains everything needed to run the test. /// The test Harness. This contains everything needed to run the test.
///
/// Create a new Harness using [`Harness::new`] or [`Harness::builder`]. /// Create a new Harness using [`Harness::new`] or [`Harness::builder`].
/// ///
/// The [Harness] has a optional generic state that can be used to pass data to the app / ui closure. /// The [Harness] has a optional generic state that can be used to pass data to the app / ui closure.

View File

@ -26,6 +26,7 @@ pub struct SnapshotOptions {
} }
/// Helper struct to define the number of pixels that can differ before the snapshot is considered a failure. /// Helper struct to define the number of pixels that can differ before the snapshot is considered a failure.
///
/// This is useful if you want to set different thresholds for different operating systems. /// This is useful if you want to set different thresholds for different operating systems.
/// ///
/// The default values are 0 / 0.0 /// The default values are 0 / 0.0

View File

@ -4,6 +4,6 @@ script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/.." cd "$script_path/.."
cargo doc -p eframe --target wasm32-unknown-unknown --lib --no-deps cargo doc -p eframe --target wasm32-unknown-unknown --lib --no-deps
cargo doc -p emath -p epaint -p egui -p eframe -p egui-winit -p egui_extras -p egui_glow --lib --no-deps --all-features --open cargo doc -p emath -p epaint -p egui -p eframe -p egui-winit -p egui_extras -p egui_glow -p egui_kittest --lib --no-deps --all-features --open
# cargo watch -c -x 'doc -p emath -p epaint -p egui --lib --no-deps --all-features' # cargo watch -c -x 'doc -p emath -p epaint -p egui --lib --no-deps --all-features'