Skip to content

Commit

Permalink
Add Lerp impl for BorderColor
Browse files Browse the repository at this point in the history
  • Loading branch information
yrns authored and mockersf committed Nov 4, 2023
1 parent e611c34 commit e800d28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/implemented.rs
Expand Up @@ -36,6 +36,17 @@ impl Lerp for EaseValue<BackgroundColor> {
}
}

#[cfg(all(feature = "ui", feature = "render"))]
impl Lerp for EaseValue<BorderColor> {
type Scalar = f32;

fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self {
EaseValue(BorderColor(
EaseValue(self.0 .0).lerp(&EaseValue(other.0 .0), scalar).0,
))
}
}

impl Lerp for EaseValue<Transform> {
type Scalar = f32;

Expand Down
2 changes: 2 additions & 0 deletions src/plugin.rs
Expand Up @@ -21,6 +21,8 @@ impl Plugin for EasingsPlugin {
app.add_systems(Update, ease_system::<Style>);
#[cfg(feature = "ui")]
app.add_systems(Update, ease_system::<BackgroundColor>);
#[cfg(feature = "ui")]
app.add_systems(Update, ease_system::<BorderColor>);
}
}

Expand Down

0 comments on commit e800d28

Please sign in to comment.