egui/crates
Jan Procházka c5eaba43cd
Fix crash on `request_animation_frame` when destroying web runner (#4169)
Previously, any frames in flight (`requestAnimationFrame`) on web were
not being cancelled (`cancelAnimationFrame`) when `WebRunner::destroy`
was called. If a user called `destroy`, then immediately removed the
canvas from the DOM, eframe could panic with a "failed to find (canvas)
element by id" error message.

This PR changes two things:
- The canvas element is directly referenced everywhere it's needed
instead of being looked up by `canvas_id`[^1]
- The RAF handle is stored in `WebRunner` and `cancelAnimationFrame` is
called on it inside of `WebRunner::destroy`[^2]

[^1]: The WebGL/WGPU backends were already holding onto the canvas (and
associated GPU context), so the change is just converting all the
`get_element_by_id` lookups to retrieve the canvas from the web runner
handle.

[^2]: There is only ever one frame in flight, so we store it directly as
a scalar field.
2024-03-14 10:26:34 +01:00
..
ecolor Release 0.26.2 - Response.interact/context_menu fix 2024-02-14 10:49:57 +01:00
eframe Fix crash on `request_animation_frame` when destroying web runner (#4169) 2024-03-14 10:26:34 +01:00
egui Improve logic for when submenus are kept open (#4166) 2024-03-13 12:32:54 +01:00
egui-wgpu Release 0.26.2 - Response.interact/context_menu fix 2024-02-14 10:49:57 +01:00
egui-winit Reduce log-level of processing ViewportCommands 2024-03-14 10:18:07 +01:00
egui_demo_app Add API for raw mouse motion (#4063) 2024-02-20 18:00:39 +01:00
egui_demo_lib A `Window` can now be resizable in only one direction (#4155) 2024-03-11 09:29:48 +01:00
egui_extras `egui_extras`: Fixed handling of `file://` protocol for images (#4107) 2024-03-08 10:24:34 +01:00
egui_glow Release 0.26.2 - Response.interact/context_menu fix 2024-02-14 10:49:57 +01:00
egui_plot egui_plot: fix panic when the base step size is set to 0 (#4078) 2024-02-20 16:26:47 +01:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Improve logic for when submenus are kept open (#4166) 2024-03-13 12:32:54 +01:00
epaint Fix scaling of rounded corners for rect shape (#4152) (#4161) 2024-03-12 11:14:24 +01:00