mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-03 07:10:05 -04:00
Fix the request_animation_frame lifetimes
This commit is contained in:
@@ -71,10 +71,13 @@ impl Window {
|
|||||||
register(&target.runner, &canvas);
|
register(&target.runner, &canvas);
|
||||||
|
|
||||||
let runner = target.runner.clone();
|
let runner = target.runner.clone();
|
||||||
let redraw = Box::new(move || window().request_animation_frame(|| runner.send_event(Event::WindowEvent {
|
let redraw = Box::new(move || {
|
||||||
window_id: RootWI(WindowId),
|
let runner = runner.clone();
|
||||||
event: WindowEvent::RedrawRequested
|
window().request_animation_frame(move |_| runner.send_event(Event::WindowEvent {
|
||||||
})));
|
window_id: RootWI(WindowId),
|
||||||
|
event: WindowEvent::RedrawRequested
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
let window = Window {
|
let window = Window {
|
||||||
canvas,
|
canvas,
|
||||||
|
|||||||
Reference in New Issue
Block a user