mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Fix the request_animation_frame lifetimes
This commit is contained in:
parent
9f801cf79e
commit
70c7382a09
|
@ -71,10 +71,13 @@ impl Window {
|
|||
register(&target.runner, &canvas);
|
||||
|
||||
let runner = target.runner.clone();
|
||||
let redraw = Box::new(move || window().request_animation_frame(|| runner.send_event(Event::WindowEvent {
|
||||
window_id: RootWI(WindowId),
|
||||
event: WindowEvent::RedrawRequested
|
||||
})));
|
||||
let redraw = Box::new(move || {
|
||||
let runner = runner.clone();
|
||||
window().request_animation_frame(move |_| runner.send_event(Event::WindowEvent {
|
||||
window_id: RootWI(WindowId),
|
||||
event: WindowEvent::RedrawRequested
|
||||
}));
|
||||
});
|
||||
|
||||
let window = Window {
|
||||
canvas,
|
||||
|
|
Loading…
Reference in a new issue