diff --git a/editor-core/src/word.rs b/editor-core/src/word.rs index 9e3ba229..08df71ea 100644 --- a/editor-core/src/word.rs +++ b/editor-core/src/word.rs @@ -490,8 +490,8 @@ mod test { fn prev_boundary_should_be_none_at_position_zero() { let rope = Rope::from("Hello world"); let mut cursor = WordCursor::new(&rope, 0); - let boudary = cursor.prev_boundary(Mode::Insert); - assert!(boudary.is_none()) + let boundary = cursor.prev_boundary(Mode::Insert); + assert!(boundary.is_none()) } #[test] diff --git a/src/inspector.rs b/src/inspector.rs index cfeadb56..044b7799 100644 --- a/src/inspector.rs +++ b/src/inspector.rs @@ -808,7 +808,7 @@ fn capture_view( .flex_col() }); - let seperator = empty().style(move |s| { + let separator = empty().style(move |s| { s.width_full() .min_height(1.0) .background(Color::BLACK.with_alpha_factor(0.2)) @@ -817,7 +817,7 @@ fn capture_view( let left = v_stack(( header("Captured Window"), scroll(image).style(|s| s.max_height_pct(60.0)), - seperator, + separator, left_scroll, )) .style(|s| s.max_width_pct(60.0)); @@ -844,13 +844,13 @@ fn capture_view( let tree = tree.style(|s| s.height_full().min_width(0).flex_basis(0).flex_grow(1.0)); - let seperator = empty().style(move |s| { + let separator = empty().style(move |s| { s.height_full() .min_width(1.0) .background(Color::BLACK.with_alpha_factor(0.2)) }); - h_stack((left, seperator, tree)).style(|s| s.height_full().width_full().max_width_full()) + h_stack((left, separator, tree)).style(|s| s.height_full().width_full().max_width_full()) } fn inspector_view( @@ -941,13 +941,13 @@ pub fn capture(window_id: WindowId) { ) .style(|s| s.flex_basis(0.0).min_height(0.0).flex_grow(1.0)); - let seperator = empty().style(move |s| { + let separator = empty().style(move |s| { s.width_full() .min_height(1.0) .background(Color::BLACK.with_alpha_factor(0.2)) }); - let stack = v_stack((tabs, seperator, tab)); + let stack = v_stack((tabs, separator, tab)); let id = stack.id(); stack .style(|s| s.width_full().height_full()) diff --git a/src/profiler.rs b/src/profiler.rs index 65fd1c86..52b7da30 100644 --- a/src/profiler.rs +++ b/src/profiler.rs @@ -161,7 +161,7 @@ fn profile_view(profile: &Rc) -> impl IntoView { )) .style(|s| s.max_width_pct(60.0).min_width(200.0)); - let seperator = empty().style(move |s| { + let separator = empty().style(move |s| { s.height_full() .min_width(1.0) .background(Color::BLACK.with_alpha_factor(0.2)) @@ -237,7 +237,7 @@ fn profile_view(profile: &Rc) -> impl IntoView { let timeline = v_stack((header("Timeline"), timeline)) .style(|s| s.min_width(0).flex_basis(0).flex_grow(1.0)); - h_stack((frames, seperator, timeline)).style(|s| s.height_full().width_full().max_width_full()) + h_stack((frames, separator, timeline)).style(|s| s.height_full().width_full().max_width_full()) } thread_local! { @@ -274,7 +274,7 @@ pub fn profiler(window_id: WindowId) -> impl IntoView { )) .style(|s| s.items_center()); - let seperator = empty().style(move |s| { + let separator = empty().style(move |s| { s.width_full() .min_height(1.0) .background(Color::BLACK.with_alpha_factor(0.2)) @@ -293,7 +293,7 @@ pub fn profiler(window_id: WindowId) -> impl IntoView { .style(|s| s.width_full().min_height(0).flex_basis(0).flex_grow(1.0)); // FIXME: This needs an extra `container` or the `v_stack` ends up horizontal. - container(v_stack((button, seperator, lower)).style(|s| s.width_full().height_full())) + container(v_stack((button, separator, lower)).style(|s| s.width_full().height_full())) .style(|s| s.width_full().height_full()) .on_event_cont(EventListener::WindowClosed, move |_| { if profiling.get() { diff --git a/src/style.rs b/src/style.rs index 4b6a9278..c926bdaa 100644 --- a/src/style.rs +++ b/src/style.rs @@ -367,17 +367,17 @@ impl StylePropReader for Option

{ } #[derive(Clone)] -pub struct ExtratorField { +pub struct ExtractorField { state: R::State, } -impl Debug for ExtratorField { +impl Debug for ExtractorField { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.state.fmt(f) } } -impl ExtratorField { +impl ExtractorField { pub fn read( &mut self, style: &Style, @@ -396,7 +396,7 @@ impl ExtratorField { } } -impl PartialEq for ExtratorField +impl PartialEq for ExtractorField where R::Type: PartialEq, { @@ -405,9 +405,9 @@ where } } -impl Eq for ExtratorField where R::Type: Eq {} +impl Eq for ExtractorField where R::Type: Eq {} -impl std::hash::Hash for ExtratorField +impl std::hash::Hash for ExtractorField where R::Type: std::hash::Hash, { @@ -458,7 +458,7 @@ macro_rules! prop_extractor { $(#[$attrs])? $vis struct $name { $( - $prop_vis $prop: $crate::style::ExtratorField<$reader>, + $prop_vis $prop: $crate::style::ExtractorField<$reader>, )* } @@ -504,7 +504,7 @@ macro_rules! prop_extractor { fn default() -> Self { Self { $( - $prop: $crate::style::ExtratorField::new(), + $prop: $crate::style::ExtractorField::new(), )* } } diff --git a/src/views/label.rs b/src/views/label.rs index 3b7f4f64..db1fc304 100644 --- a/src/views/label.rs +++ b/src/views/label.rs @@ -16,7 +16,7 @@ use peniko::Color; use taffy::tree::NodeId; prop_extractor! { - Extracter { + Extractor { color: TextColor, text_overflow: TextOverflowProp, line_height: LineHeight, @@ -39,7 +39,7 @@ pub struct Label { available_text_layout: Option, text_overflow_listener: Option, font: FontProps, - style: Extracter, + style: Extractor, } impl Label { diff --git a/src/views/text_input.rs b/src/views/text_input.rs index d3283da9..303d47d5 100644 --- a/src/views/text_input.rs +++ b/src/views/text_input.rs @@ -37,7 +37,7 @@ style_class!(pub TextInputClass); style_class!(pub PlaceholderTextClass); prop_extractor! { - Extracter { + Extractor { color: TextColor, } } @@ -90,7 +90,7 @@ pub struct TextInput { height: f32, // Approx max size of a glyph, given the current font weight & size. glyph_max_size: Size, - style: Extracter, + style: Extractor, font: FontProps, cursor_width: f64, // TODO: make this configurable is_focused: bool, diff --git a/src/window_handle.rs b/src/window_handle.rs index 1b7c3c3b..77ec3577 100644 --- a/src/window_handle.rs +++ b/src/window_handle.rs @@ -1499,7 +1499,7 @@ fn context_menu_view( .style(move |s| { let window_size = window_size.get(); let menu_size = context_menu_size.get(); - let is_acitve = context_menu.with(|m| m.is_some()); + let is_active = context_menu.with(|m| m.is_some()); let mut pos = context_menu.with(|m| m.as_ref().map(|(_, pos)| *pos).unwrap_or_default()); if pos.x + menu_size.width > window_size.width { pos.x = window_size.width - menu_size.width; @@ -1519,7 +1519,7 @@ fn context_menu_view( .margin_left(pos.x as f32) .margin_top(pos.y as f32) .cursor(CursorStyle::Default) - .apply_if(!is_acitve, |s| s.hide()) + .apply_if(!is_active, |s| s.hide()) .box_shadow_blur(5.0) .box_shadow_color(Color::BLACK) }); diff --git a/tiny_skia/src/lib.rs b/tiny_skia/src/lib.rs index 0a16e90e..e468e773 100644 --- a/tiny_skia/src/lib.rs +++ b/tiny_skia/src/lib.rs @@ -285,15 +285,15 @@ impl TinySkiaRenderer { } fn current_transform(&self) -> Transform { - let transfrom = self.transform.as_coeffs(); + let transform = self.transform.as_coeffs(); let scale = self.scale as f32; Transform::from_row( - transfrom[0] as f32, - transfrom[1] as f32, - transfrom[2] as f32, - transfrom[3] as f32, - transfrom[4] as f32, - transfrom[5] as f32, + transform[0] as f32, + transform[1] as f32, + transform[2] as f32, + transform[3] as f32, + transform[4] as f32, + transform[5] as f32, ) .post_scale(scale, scale) }