Skip to content

Commit

Permalink
Simplify render_immediate_viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 14, 2023
1 parent 67c192b commit 2c9426b
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions crates/eframe/src/native/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,7 @@ mod wgpu_integration {

let ImmediateViewport {
ids,
mut builder,
builder,
viewport_ui_cb,
} = immediate_viewport;

Expand All @@ -2145,21 +2145,7 @@ mod wgpu_integration {
painter,
viewport_maps,
} = &mut *shared;

if builder.icon.is_none() {
// Inherit icon from parent
builder.icon = viewports
.get(&ids.parent)
.and_then(|vp| vp.builder.icon.clone());
}

let viewport = viewports.entry(ids.this).or_insert(Viewport {
ids,
builder,
viewport_ui_cb: None,
window: None,
egui_winit: None,
});
let viewport = initialize_or_update_viewport(viewports, ids, builder, None, None);

if viewport.window.is_none() {
viewport.init_window(viewport_maps, painter, event_loop);
Expand Down Expand Up @@ -2623,6 +2609,7 @@ mod wgpu_integration {
.get(&window_id)
.and_then(|id| viewports.get(id))
.and_then(|vp| vp.window.as_ref());

integration.maybe_autosave(app.as_mut(), window.map(|w| w.as_ref()));

if let Some(window) = window {
Expand Down

0 comments on commit 2c9426b

Please sign in to comment.