1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Make frame delay on screenshots consistently one frame on web as well (#5482)

Native is already delayed by a frame because it calls
`handle_viewport_output` -> `egui_winit::process_viewport_commands`
after drawing. On web however, we process input including viewport
commands separately from drawing.
This adds an arbitrary frame delay mechanism for web and then uses this
with 1 frame delay always
This commit is contained in:
Andreas Reich
2024-12-16 15:03:01 +01:00
committed by GitHub
parent 3995491212
commit b1d2551e7e
2 changed files with 23 additions and 7 deletions

View File

@@ -1056,7 +1056,7 @@ pub enum ViewportCommand {
/// Enable mouse pass-through: mouse clicks pass through the window, used for non-interactable overlays.
MousePassthrough(bool),
/// Take a screenshot.
/// Take a screenshot of the next frame after this.
///
/// The results are returned in [`crate::Event::Screenshot`].
Screenshot(crate::UserData),