mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
egui_kittest: Allow passing state to the app closure (#5313)
The allows us to pass any state to the ui closure. While it is possible to just store state in the closure itself, accessing that state after the harness was created to e.g. read or modify it would require interior mutability. With this change there are new `Harness::new_state`, `Harness::run_state`, ... methods that allow passing state on each run. This builds on top of #5301, which should be merged first --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -288,7 +288,7 @@ pub fn image_snapshot(current: &image::RgbaImage, name: &str) {
|
||||
}
|
||||
|
||||
#[cfg(feature = "wgpu")]
|
||||
impl Harness<'_> {
|
||||
impl<State> Harness<'_, State> {
|
||||
/// Render a image using a default [`crate::wgpu::TestRenderer`] and compare it to the snapshot
|
||||
/// with custom options.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user