mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
borrow_mut -> replace
This commit is contained in:
@@ -1110,13 +1110,13 @@ mod glow_integration {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
*self.running.borrow_mut() = Some(GlowWinitRunning {
|
self.running.replace(Some(GlowWinitRunning {
|
||||||
glutin_ctx,
|
glutin_ctx,
|
||||||
gl,
|
gl,
|
||||||
painter,
|
painter,
|
||||||
integration: Rc::new(RefCell::new(integration)),
|
integration: Rc::new(RefCell::new(integration)),
|
||||||
app: Rc::new(RefCell::new(app)),
|
app: Rc::new(RefCell::new(app)),
|
||||||
});
|
}));
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -1742,7 +1742,8 @@ mod glow_integration {
|
|||||||
|
|
||||||
match &event {
|
match &event {
|
||||||
winit::event::WindowEvent::Focused(new_focused) => {
|
winit::event::WindowEvent::Focused(new_focused) => {
|
||||||
*self.focused_viewport.borrow_mut() = new_focused
|
self.focused_viewport.replace(
|
||||||
|
new_focused
|
||||||
.then(|| {
|
.then(|| {
|
||||||
running
|
running
|
||||||
.glutin_ctx
|
.glutin_ctx
|
||||||
@@ -1751,7 +1752,8 @@ mod glow_integration {
|
|||||||
.get(window_id)
|
.get(window_id)
|
||||||
.copied()
|
.copied()
|
||||||
})
|
})
|
||||||
.flatten();
|
.flatten(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
winit::event::WindowEvent::Resized(physical_size) => {
|
winit::event::WindowEvent::Resized(physical_size) => {
|
||||||
repaint_asap = true;
|
repaint_asap = true;
|
||||||
@@ -2705,8 +2707,8 @@ mod wgpu_integration {
|
|||||||
|
|
||||||
match &event {
|
match &event {
|
||||||
winit::event::WindowEvent::Focused(new_focused) => {
|
winit::event::WindowEvent::Focused(new_focused) => {
|
||||||
*self.focused_viewport.borrow_mut() =
|
self.focused_viewport
|
||||||
new_focused.then(|| viewport_id).flatten();
|
.replace(new_focused.then(|| viewport_id).flatten());
|
||||||
}
|
}
|
||||||
winit::event::WindowEvent::Resized(physical_size) => {
|
winit::event::WindowEvent::Resized(physical_size) => {
|
||||||
repaint_asap = true;
|
repaint_asap = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user