Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce typo count #660

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reactive/src/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ where
T: PartialEq + 'static,
{
let cx = Scope::current();
let inital = f(None);
let (getter, setter) = create_signal(inital);
let initial = f(None);
let (getter, setter) = create_signal(initial);
let reader = getter.read_untracked();

create_effect(move |_| {
Expand Down
12 changes: 6 additions & 6 deletions src/animate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ pub struct Animation {
pub(crate) cache: PropCache,
/// This will fire at the start of each cycle of an animation.
pub(crate) on_start: Trigger,
/// This tigger will fire at the completion of an animations duration.
/// This trigger will fire at the completion of an animations duration.
/// Animations are allowed to go on for longer than their duration, until the easing reports finished.
/// When waiting for the completion of an animation (such as to remove a view), this trigger should be preferred.
pub(crate) on_visual_complete: Trigger,
Expand Down Expand Up @@ -416,7 +416,7 @@ impl Animation {
}

/// Quickly set a few properties on an animation to set up an animation to be used as a view transition (on creation and removal).
/// (Sets keyframes 0 and 100 to use the computed style until overriden)
/// (Sets keyframes 0 and 100 to use the computed style until overridden)
pub fn view_transition(self) -> Self {
self.run_on_create(true)
.run_on_remove(true)
Expand Down Expand Up @@ -661,7 +661,7 @@ impl Animation {
pub fn state(
mut self,
command: impl Fn() -> AnimStateCommand + 'static,
apply_inital: bool,
apply_initial: bool,
) -> Self {
let states = RwSignal::new(SmallVec::new());
self.effect_states.push(states);
Expand All @@ -670,7 +670,7 @@ impl Animation {
view_id.update_animation_state(stack_offset, command)
}
});
if apply_inital {
if apply_initial {
self.transition(initial_command);
}
self
Expand Down Expand Up @@ -1037,7 +1037,7 @@ impl Animation {

let computed_idxs = self.cache.computed_idxs.clone();
for computed_idx in &computed_idxs {
// we add all of the props from the computed style to the cache becaues the computed style could change inbetween every frame.
// we add all of the props from the computed style to the cache because the computed style could change inbetween every frame.
for prop in computed_style.style_props() {
self.cache
.insert_computed_prop(prop, PropFrameKind::Computed(*computed_idx));
Expand Down Expand Up @@ -1106,7 +1106,7 @@ impl Animation {

computed_style.apply_mut(self.folded_style.clone());

// we remove all of the props in the computed style from the cache becaues the computed style could change inbetween every frame.
// we remove all of the props in the computed style from the cache because the computed style could change inbetween every frame.
for computed_idx in computed_idxs {
for prop in computed_style.style_props() {
self.cache.remove_prop(prop, computed_idx);
Expand Down
6 changes: 3 additions & 3 deletions src/ext_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub fn create_signal_from_tokio_channel<T: Send + 'static>(

#[cfg(feature = "futures")]
pub fn create_signal_from_stream<T: 'static>(
inital_value: T,
initial_value: T,
stream: impl futures::Stream<Item = T> + 'static,
) -> ReadSignal<T> {
use std::{
Expand All @@ -212,10 +212,10 @@ pub fn create_signal_from_stream<T: 'static>(

let cx = Scope::current().create_child();
let trigger = cx.create_trigger();
let (read, write) = cx.create_signal(inital_value);
let (read, write) = cx.create_signal(initial_value);

/// Waker that wakes by registering a trigger
// TODO: since the trigger is just a `u64`, it could theorically be changed to be a `usize`,
// TODO: since the trigger is just a `u64`, it could theoretically be changed to be a `usize`,
// Then the implementation of the std::task::RawWakerVTable could pass the `usize` as the data pointer,
// avoiding any allocation/reference counting
struct TriggerWake(Trigger);
Expand Down
4 changes: 2 additions & 2 deletions src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl ViewId {
self.state().borrow_mut().context_menu = Some(Rc::new(menu));
}

/// Set the sytem popout menu that should be shown when this view is clicked
/// Set the system popout menu that should be shown when this view is clicked
///
/// Adds a primary-click context menu, which opens below the view.
pub fn update_popout_menu(&self, menu: impl Fn() -> Menu + 'static) {
Expand Down Expand Up @@ -432,7 +432,7 @@ impl ViewId {

/// Get the combined style that is associated with this View.
///
/// This will have all of the style properties set in it that are relevent to this view, including all properties from relevant classes.
/// This will have all of the style properties set in it that are relevant to this view, including all properties from relevant classes.
///
/// ## Warning
/// The view styles do not store property transition states, only markers of which properties _should_ be transitioned over time on change.
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
//! [`Decorators`](crate::views::Decorators) trait to use the it). The `style` method takes a closure that takes and returns a
//! [`Style`](crate::style::Style) value using the builder pattern. Through this value, you can access methods that modify a variety
//! of familiar properties such as width, padding, and background. Some `Style` properties
//! such as font size are `inherited` and will apply to all of a view's children until overriden.
//! such as font size are `inherited` and will apply to all of a view's children until overridden.
// TODO: Add links on these
//!
//! In this same style value, floem supports:
Expand Down
8 changes: 4 additions & 4 deletions src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl StylePropValue for PxPctAuto {
(Self::Px(v1), Self::Px(v2)) => Some(Self::Px(v1 + (v2 - v1) * value)),
(Self::Pct(v1), Self::Pct(v2)) => Some(Self::Pct(v1 + (v2 - v1) * value)),
(Self::Auto, Self::Auto) => Some(Self::Auto),
// TODO: Figure out some way to get in the relevent layout information in order to interpolate betweeen pixels and percent
// TODO: Figure out some way to get in the relevant layout information in order to interpolate between pixels and percent
_ => None,
}
}
Expand All @@ -196,7 +196,7 @@ impl StylePropValue for PxPct {
match (self, other) {
(Self::Px(v1), Self::Px(v2)) => Some(Self::Px(v1 + (v2 - v1) * value)),
(Self::Pct(v1), Self::Pct(v2)) => Some(Self::Pct(v1 + (v2 - v1) * value)),
// TODO: Figure out some way to get in the relevent layout information in order to interpolate betweeen pixels and percent
// TODO: Figure out some way to get in the relevant layout information in order to interpolate between pixels and percent
_ => None,
}
}
Expand Down Expand Up @@ -373,7 +373,7 @@ impl StylePropValue for Gradient {
}
}

// this is necessary because Stroke doens't impl partial eq. it probaly should...
// this is necessary because Stroke doesn't impl partial eq. it probably should...
#[derive(Clone, Debug)]
pub struct StrokeWrap(pub Stroke);
impl StrokeWrap {
Expand Down Expand Up @@ -2399,7 +2399,7 @@ pub trait CustomStylable<S: Default + Into<Style> + 'static>:
{
type DV: View;

/// # Add a custom style to the view with acess to this view's specialized custom style.
/// # Add a custom style to the view with access to this view's specialized custom style.
///
/// A note for implementors of the trait:
///
Expand Down
2 changes: 1 addition & 1 deletion src/view_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl IsHiddenState {
) {
let computed_has_hide = computed_display == taffy::Display::None;
*self = match self {
// initial states (makes it so that the animations aren't run on intial app/view load)
// initial states (makes it so that the animations aren't run on initial app/view load)
Self::None if computed_has_hide => Self::Hidden,
Self::None if !computed_has_hide => Self::Visible(computed_display),
// do nothing
Expand Down
4 changes: 2 additions & 2 deletions src/views/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl Scroll {
/// # Reactivity
/// The viewport will automatically update to include the target rectangle whenever the rectangle's
/// position or size changes, as determined by the `to` function which will update any time there are
/// chagnes in the signals that it depends on.
/// changes in the signals that it depends on.
pub fn ensure_visible(self, to: impl Fn() -> Rect + 'static) -> Self {
let id = self.id();
create_effect(move |_| {
Expand All @@ -222,7 +222,7 @@ impl Scroll {
///
/// # Reactivity
/// The scroll position will automatically update whenever the delta vector changes,
/// as determined by the `delta` function which will update any time there are chagnes in the signals that it depends on.
/// as determined by the `delta` function which will update any time there are changes in the signals that it depends on.
pub fn scroll_delta(self, delta: impl Fn() -> Vec2 + 'static) -> Self {
let id = self.id();
create_effect(move |_| {
Expand Down
2 changes: 1 addition & 1 deletion vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Renderer for VelloRenderer {
match &brush {
BrushRef::Solid(color) => {
let mut stroke = stroke.clone();
// this special handlign is done to make thin strokes look better
// this special handling is done to make thin strokes look better
stroke.width *= 1.5;
let color = color.multiply_alpha(0.5);
self.scene.stroke(
Expand Down