mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Fix web demo
This commit is contained in:
@@ -178,14 +178,15 @@ impl AppRunner {
|
|||||||
let canvas_size = super::canvas_size_in_points(self.canvas_id());
|
let canvas_size = super::canvas_size_in_points(self.canvas_id());
|
||||||
let raw_input = self.input.new_frame(canvas_size);
|
let raw_input = self.input.new_frame(canvas_size);
|
||||||
|
|
||||||
let full_output = self.egui_ctx.run(raw_input, |egui_ctx| {
|
let full_output = self.egui_ctx.run(raw_input, 0, 0, |egui_ctx| {
|
||||||
self.app.update(egui_ctx, &mut self.frame);
|
self.app.update(egui_ctx, &mut self.frame, None);
|
||||||
});
|
});
|
||||||
let egui::FullOutput {
|
let egui::FullOutput {
|
||||||
platform_output,
|
platform_output,
|
||||||
repaint_after,
|
repaint_after,
|
||||||
textures_delta,
|
textures_delta,
|
||||||
shapes,
|
shapes,
|
||||||
|
..
|
||||||
} = full_output;
|
} = full_output;
|
||||||
|
|
||||||
self.handle_platform_output(platform_output);
|
self.handle_platform_output(platform_output);
|
||||||
@@ -199,6 +200,7 @@ impl AppRunner {
|
|||||||
|
|
||||||
self.frame.info.cpu_usage = Some((now_sec() - frame_start) as f32);
|
self.frame.info.cpu_usage = Some((now_sec() - frame_start) as f32);
|
||||||
|
|
||||||
|
let (_, repaint_after) = repaint_after[0];
|
||||||
(repaint_after, clipped_primitives)
|
(repaint_after, clipped_primitives)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use egui::ViewportRender;
|
||||||
use egui_extras::RetainedImage;
|
use egui_extras::RetainedImage;
|
||||||
use poll_promise::Promise;
|
use poll_promise::Promise;
|
||||||
|
|
||||||
@@ -54,7 +55,12 @@ impl Default for HttpApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl eframe::App for HttpApp {
|
impl eframe::App for HttpApp {
|
||||||
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
|
fn update(
|
||||||
|
&mut self,
|
||||||
|
ctx: &egui::Context,
|
||||||
|
frame: &mut eframe::Frame,
|
||||||
|
_: Option<&ViewportRender>,
|
||||||
|
) {
|
||||||
egui::TopBottomPanel::bottom("http_bottom").show(ctx, |ui| {
|
egui::TopBottomPanel::bottom("http_bottom").show(ctx, |ui| {
|
||||||
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
|
let layout = egui::Layout::top_down(egui::Align::Center).with_main_justify(true);
|
||||||
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {
|
ui.allocate_ui_with_layout(ui.available_size(), layout, |ui| {
|
||||||
|
|||||||
Reference in New Issue
Block a user