Skip to content

Commit

Permalink
Spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 3, 2023
1 parent 51b083a commit 29e1c4d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions crates/egui-wgpu/src/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
28 changes: 14 additions & 14 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -1582,7 +1582,7 @@ impl Context {
used,
render,
}| {
let out = *used;
let retain = *used;

if viewport_id == pair.parent {
*used = false;
Expand All @@ -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)
},
);
});
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions examples/viewports/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ fn drop_target<R>(

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() {
Expand Down

0 comments on commit 29e1c4d

Please sign in to comment.