diff --git a/crates/egui-wgpu/src/winit.rs b/crates/egui-wgpu/src/winit.rs index eac3b18dfd7..58d834af97c 100644 --- a/crates/egui-wgpu/src/winit.rs +++ b/crates/egui-wgpu/src/winit.rs @@ -620,13 +620,13 @@ impl Painter { screenshot } - pub fn clean_surfaces(&mut self, avalibile_viewports: &[ViewportId]) { + pub fn clean_surfaces(&mut self, available_viewports: &[ViewportId]) { self.surfaces - .retain(|id, _| avalibile_viewports.contains(id)); + .retain(|id, _| available_viewports.contains(id)); self.depth_texture_view - .retain(|id, _| avalibile_viewports.contains(id)); + .retain(|id, _| available_viewports.contains(id)); self.msaa_texture_view - .retain(|id, _| avalibile_viewports.contains(id)); + .retain(|id, _| available_viewports.contains(id)); } #[allow(clippy::unused_self)] diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 9ea9a3961e2..30de5e359e2 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -1211,7 +1211,7 @@ pub fn changes_between_builders( let mut commands = Vec::new(); // Title is not compared because if has a new title will create a new window - // The title of a avalibile window can only be changed with ViewportCommand::Title + // The title of a available window can only be changed with ViewportCommand::Title if let Some(position) = new.position { if Some(position) != last.position { diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 9ae4de1880a..27b33982da9 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -1558,16 +1558,16 @@ impl Context { let shapes = self.drain_paint_lists(); // If there are no viewport that contains the current viewport that viewport needs to be destroyed! - let avalibile_viewports = self.read(|ctx| { - let mut avalibile_viewports = vec![ViewportId::MAIN]; + let available_viewports = self.read(|ctx| { + let mut available_viewports = vec![ViewportId::MAIN]; for Viewport { pair: ViewportIdPair { this, .. }, .. } in ctx.viewports.values() { - avalibile_viewports.push(*this); + available_viewports.push(*this); } - avalibile_viewports + available_viewports }); let viewport_id = self.viewport_id(); @@ -1582,7 +1582,7 @@ impl Context { used, render, }| { - let out = *used; + let retain = *used; if viewport_id == pair.parent { *used = false; @@ -1593,8 +1593,8 @@ impl Context { pair: *pair, render: render.clone(), }); - (out || viewport_id != pair.parent) - && avalibile_viewports.contains(&pair.parent) + (retain || viewport_id != pair.parent) + && available_viewports.contains(&pair.parent) }, ); }); @@ -1617,20 +1617,20 @@ impl Context { } else { // ## Context Cleanup self.write(|ctx| { - ctx.input.retain(|id, _| avalibile_viewports.contains(id)); + ctx.input.retain(|id, _| available_viewports.contains(id)); ctx.layer_rects_prev_viewports - .retain(|id, _| avalibile_viewports.contains(id)); + .retain(|id, _| available_viewports.contains(id)); ctx.layer_rects_this_viewports - .retain(|id, _| avalibile_viewports.contains(id)); - ctx.output.retain(|id, _| avalibile_viewports.contains(id)); + .retain(|id, _| available_viewports.contains(id)); + ctx.output.retain(|id, _| available_viewports.contains(id)); ctx.frame_state - .retain(|id, _| avalibile_viewports.contains(id)); + .retain(|id, _| available_viewports.contains(id)); ctx.graphics - .retain(|id, _| avalibile_viewports.contains(id)); + .retain(|id, _| available_viewports.contains(id)); }); } - self.write(|ctx| ctx.repaint.end_frame(viewport_id, &avalibile_viewports)); + self.write(|ctx| ctx.repaint.end_frame(viewport_id, &available_viewports)); FullOutput { platform_output, diff --git a/examples/viewports/src/main.rs b/examples/viewports/src/main.rs index 873a0888dac..f968be25fa7 100644 --- a/examples/viewports/src/main.rs +++ b/examples/viewports/src/main.rs @@ -275,13 +275,13 @@ fn drop_target( let background_id = ui.painter().add(egui::Shape::Noop); - let avalibile_rect = ui.available_rect_before_wrap(); - let inner_rect = avalibile_rect.shrink2(margin); + let available_rect = ui.available_rect_before_wrap(); + let inner_rect = available_rect.shrink2(margin); let mut content_ui = ui.child_ui(inner_rect, *ui.layout()); let ret = body(&mut content_ui); let outer_rect = - egui::Rect::from_min_max(avalibile_rect.min, content_ui.min_rect().max + margin); + egui::Rect::from_min_max(available_rect.min, content_ui.min_rect().max + margin); let (rect, response) = ui.allocate_at_least(outer_rect.size(), egui::Sense::hover()); let style = if is_being_dragged && response.hovered() {