mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Replace Context::begin_frame/end_frame with fn run taking a closure (#872)
* Replace Context begin_frame/end_frame with `fn run` taking a closure * Create `egui::__run_test_ui` to replace `Ui::__test` * Add helper `egui::__run_test_ctx` for doctests
This commit is contained in:
@@ -189,8 +189,6 @@ impl AppRunner {
|
||||
let canvas_size = canvas_size_in_points(self.canvas_id());
|
||||
let raw_input = self.input.new_frame(canvas_size);
|
||||
|
||||
self.egui_ctx.begin_frame(raw_input);
|
||||
|
||||
let mut app_output = epi::backend::AppOutput::default();
|
||||
let mut frame = epi::backend::FrameBuilder {
|
||||
info: self.integration_info(),
|
||||
@@ -200,9 +198,10 @@ impl AppRunner {
|
||||
}
|
||||
.build();
|
||||
|
||||
self.app.update(&self.egui_ctx, &mut frame);
|
||||
|
||||
let (egui_output, shapes) = self.egui_ctx.end_frame();
|
||||
let app = &mut self.app; // TODO: remove when we bump MSRV to 1.56
|
||||
let (egui_output, shapes) = self.egui_ctx.run(raw_input, |egui_ctx| {
|
||||
app.update(egui_ctx, &mut frame);
|
||||
});
|
||||
let clipped_meshes = self.egui_ctx.tessellate(shapes);
|
||||
|
||||
self.handle_egui_output(&egui_output);
|
||||
|
||||
Reference in New Issue
Block a user