Skip to content

Commit

Permalink
Fix typos in code / identifiers. (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Jun 2, 2024
1 parent dde5a1b commit aa80194
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions editor-core/src/word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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));
Expand All @@ -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(
Expand Down Expand Up @@ -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())
Expand Down
8 changes: 4 additions & 4 deletions src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fn profile_view(profile: &Rc<Profile>) -> 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))
Expand Down Expand Up @@ -237,7 +237,7 @@ fn profile_view(profile: &Rc<Profile>) -> 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! {
Expand Down Expand Up @@ -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))
Expand All @@ -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() {
Expand Down
16 changes: 8 additions & 8 deletions src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,17 @@ impl<P: StyleProp> StylePropReader for Option<P> {
}

#[derive(Clone)]
pub struct ExtratorField<R: StylePropReader> {
pub struct ExtractorField<R: StylePropReader> {
state: R::State,
}

impl<R: StylePropReader> Debug for ExtratorField<R> {
impl<R: StylePropReader> Debug for ExtractorField<R> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.state.fmt(f)
}
}

impl<R: StylePropReader> ExtratorField<R> {
impl<R: StylePropReader> ExtractorField<R> {
pub fn read(
&mut self,
style: &Style,
Expand All @@ -396,7 +396,7 @@ impl<R: StylePropReader> ExtratorField<R> {
}
}

impl<R: StylePropReader> PartialEq for ExtratorField<R>
impl<R: StylePropReader> PartialEq for ExtractorField<R>
where
R::Type: PartialEq,
{
Expand All @@ -405,9 +405,9 @@ where
}
}

impl<R: StylePropReader> Eq for ExtratorField<R> where R::Type: Eq {}
impl<R: StylePropReader> Eq for ExtractorField<R> where R::Type: Eq {}

impl<R: StylePropReader> std::hash::Hash for ExtratorField<R>
impl<R: StylePropReader> std::hash::Hash for ExtractorField<R>
where
R::Type: std::hash::Hash,
{
Expand Down Expand Up @@ -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>,
)*
}

Expand Down Expand Up @@ -504,7 +504,7 @@ macro_rules! prop_extractor {
fn default() -> Self {
Self {
$(
$prop: $crate::style::ExtratorField::new(),
$prop: $crate::style::ExtractorField::new(),
)*
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use peniko::Color;
use taffy::tree::NodeId;

prop_extractor! {
Extracter {
Extractor {
color: TextColor,
text_overflow: TextOverflowProp,
line_height: LineHeight,
Expand All @@ -39,7 +39,7 @@ pub struct Label {
available_text_layout: Option<TextLayout>,
text_overflow_listener: Option<TextOverflowListener>,
font: FontProps,
style: Extracter,
style: Extractor,
}

impl Label {
Expand Down
4 changes: 2 additions & 2 deletions src/views/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ style_class!(pub TextInputClass);
style_class!(pub PlaceholderTextClass);

prop_extractor! {
Extracter {
Extractor {
color: TextColor,
}
}
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/window_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
});
Expand Down
14 changes: 7 additions & 7 deletions tiny_skia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ impl<W> TinySkiaRenderer<W> {
}

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)
}
Expand Down

0 comments on commit aa80194

Please sign in to comment.