diff --git a/crates/egui_extras/src/dock/branch/grid.rs b/crates/egui_extras/src/dock/branch/grid.rs index fe52c799f..24c365f61 100644 --- a/crates/egui_extras/src/dock/branch/grid.rs +++ b/crates/egui_extras/src/dock/branch/grid.rs @@ -38,9 +38,9 @@ pub struct Grid { pub locations: HashMap, - /// Share of the avilable width assigned to each column. + /// Share of the available width assigned to each column. pub col_shares: Vec, - /// Share of the avilable height assigned to each row. + /// Share of the available height assigned to each row. pub row_shares: Vec, } diff --git a/crates/egui_extras/src/dock/branch/linear.rs b/crates/egui_extras/src/dock/branch/linear.rs index 8931b1414..bbfe49673 100644 --- a/crates/egui_extras/src/dock/branch/linear.rs +++ b/crates/egui_extras/src/dock/branch/linear.rs @@ -327,7 +327,7 @@ fn linear_drop_zones( .iter() .position(|&child| is_being_dragged(egui_ctx, child)); - let afer_rect = |rect: Rect| match dir { + let after_rect = |rect: Rect| match dir { LinearDir::Horizontal => Rect::from_min_max( rect.right_top() - vec2(preview_thickness, 0.0), rect.right_bottom(), @@ -345,7 +345,7 @@ fn linear_drop_zones( dir, |node_id| nodes.rect(node_id), add_drop_drect, - afer_rect, + after_rect, ); } @@ -356,7 +356,7 @@ pub fn drop_zones( dir: LinearDir, get_rect: impl Fn(NodeId) -> Rect, mut add_drop_drect: impl FnMut(Rect, usize), - afer_rect: impl Fn(Rect) -> Rect, + after_rect: impl Fn(Rect) -> Rect, ) { let before_rect = |rect: Rect| match dir { LinearDir::Horizontal => Rect::from_min_max( @@ -380,7 +380,7 @@ pub fn drop_zones( }; let mut prev_rect: Option = None; - let mut insertion_index = 0; // skips over drag-source, if any, beacuse it will be removed before its re-inserted + let mut insertion_index = 0; // skips over drag-source, if any, because it will be removed before its re-inserted for (i, &child) in children.iter().enumerate() { let rect = get_rect(child); @@ -407,6 +407,6 @@ pub fn drop_zones( if let Some(last_rect) = prev_rect { // Suggest dropping after the last child: - add_drop_drect(afer_rect(last_rect), insertion_index + 1); + add_drop_drect(after_rect(last_rect), insertion_index + 1); } } diff --git a/crates/egui_extras/src/dock/branch/tabs.rs b/crates/egui_extras/src/dock/branch/tabs.rs index 43445b61a..3e7703d00 100644 --- a/crates/egui_extras/src/dock/branch/tabs.rs +++ b/crates/egui_extras/src/dock/branch/tabs.rs @@ -85,7 +85,7 @@ impl Tabs { } let preview_thickness = 6.0; - let afer_rect = |rect: Rect| { + let after_rect = |rect: Rect| { let dragged_size = if let Some(dragged_index) = dragged_index { // We actually know the size of this thing button_rects[&self.children[dragged_index]].size() @@ -107,7 +107,7 @@ impl Tabs { drop_context .suggest_rect(InsertionPoint::new(node_id, LayoutInsertion::Tabs(i)), rect); }, - afer_rect, + after_rect, ); }); @@ -118,7 +118,7 @@ impl Tabs { nodes.node_ui(behavior, drop_context, ui, self.active); } - // We have only layed out the active tab, so we need to switch active tab after the ui pass: + // We have only laid out the active tab, so we need to switch active tab after the ui pass: self.active = next_active; } } diff --git a/crates/egui_extras/src/dock/mod.rs b/crates/egui_extras/src/dock/mod.rs index 1a9cb3d3c..300f739a7 100644 --- a/crates/egui_extras/src/dock/mod.rs +++ b/crates/egui_extras/src/dock/mod.rs @@ -39,7 +39,7 @@ impl std::fmt::Debug for NodeId { } } -/// The top level type. Contains all peristent state, including layouts and sizes. +/// The top level type. Contains all persistent state, including layouts and sizes. #[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct Dock { pub root: NodeId, diff --git a/crates/emath/src/rect.rs b/crates/emath/src/rect.rs index 464aded69..5020b1218 100644 --- a/crates/emath/src/rect.rs +++ b/crates/emath/src/rect.rs @@ -537,24 +537,24 @@ impl Rect { pos2(self.right(), self.bottom()) } - /// Split rectangle in left and right halfs. `t` is expected to be in the (0,1) range. + /// Split rectangle in left and right halves. `t` is expected to be in the (0,1) range. pub fn split_left_right_at_fraction(&self, t: f32) -> (Rect, Rect) { self.split_left_right_at_x(lerp(self.min.x..=self.max.x, t)) } - /// Split rectangle in left and right halfs at the given `x` coordinate. + /// Split rectangle in left and right halves at the given `x` coordinate. pub fn split_left_right_at_x(&self, split_x: f32) -> (Rect, Rect) { let left = Rect::from_min_max(self.min, Pos2::new(split_x, self.max.y)); let right = Rect::from_min_max(Pos2::new(split_x, self.min.y), self.max); (left, right) } - /// Split rectangle in top and bottom halfs. `t` is expected to be in the (0,1) range. + /// Split rectangle in top and bottom halves. `t` is expected to be in the (0,1) range. pub fn split_top_bottom_at_fraction(&self, t: f32) -> (Rect, Rect) { self.split_top_bottom_at_y(lerp(self.min.y..=self.max.y, t)) } - /// Split rectangle in top and bottom halfs at the given `y` coordinate. + /// Split rectangle in top and bottom halves at the given `y` coordinate. pub fn split_top_bottom_at_y(&self, split_y: f32) -> (Rect, Rect) { let top = Rect::from_min_max(self.min, Pos2::new(self.max.x, split_y)); let bottom = Rect::from_min_max(Pos2::new(self.min.x, split_y), self.max);