1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Add an option to limit the repaint rate in the web runner (#7482)

Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
Sven Niederberger
2025-09-09 13:49:35 +02:00
committed by GitHub
parent 9db03983dd
commit ec5bc35c38
4 changed files with 48 additions and 14 deletions

View File

@@ -96,7 +96,8 @@ impl AppRunner {
wgpu_render_state: None,
};
let needs_repaint: std::sync::Arc<NeedRepaint> = Default::default();
let needs_repaint: std::sync::Arc<NeedRepaint> =
std::sync::Arc::new(NeedRepaint::new(web_options.max_fps));
{
let needs_repaint = needs_repaint.clone();
egui_ctx.set_request_repaint_callback(move |info| {