Skip to content

Commit

Permalink
feat(macros): 🎸 derive Declare will generate FatObj
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Adoo committed Mar 8, 2024
1 parent cfde1ac commit 542f21a
Show file tree
Hide file tree
Showing 43 changed files with 1,592 additions and 484 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Please only add new entries below the [Unreleased](#unreleased---releasedate) he

## Breaking

- **core**: removed `FatObj::unzip`. (#535 @M-Adoo)
- **core**: removed `FatObj::unzip` and `BuiltinObj`. (#535 @M-Adoo)
While these are public APIs, they are typically not required for direct use in user code.


## [0.2.0-alpha.5] - 2024-03-05
Expand Down
2 changes: 1 addition & 1 deletion core/src/animation/animate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{prelude::*, ticker::FrameMsg, window::WindowId};
use std::time::Instant;

#[derive(Declare)]
#[simple_declare]
pub struct Animate<S>
where
S: AnimateState + 'static,
Expand Down
8 changes: 4 additions & 4 deletions core/src/animation/stagger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! let first_fade_in = @Animate {
//! transition: transitions::EASE_IN.of(ctx!()),
//! state: map_writer!($first.opacity),
//! }.into_inner();
//! };
//!
//! stagger.write().push_animation(first_fade_in);
//! stagger.write().push_state(map_writer!($second.opacity), 0., ctx!());
Expand Down Expand Up @@ -103,7 +103,7 @@ impl<T: Transition + 'static> Stagger<T> {
A: AnimateState + 'static,
{
let transition = Box::new(self.transition.clone());
let animate = rdl! { Animate { transition, state, from } }.into_inner();
let animate = rdl! { Animate { transition, state, from } };
self.push_animation_with(stagger, animate.clone_writer().into_inner());
animate
}
Expand All @@ -116,7 +116,7 @@ impl<T: Transition + 'static> Stagger<T> {
/// Add an animation to the end of the stagger animation with a different
/// stagger duration.
///
/// **stagger**: the duration between the previous animation start and this
/// **stagger**: the duration between the previous animation start and this
/// animation start.
pub fn push_animation_with(
&mut self,
Expand Down Expand Up @@ -237,7 +237,7 @@ mod tests {
from: 0.,
};

stagger.write().push_animation(animate.into_inner());
stagger.write().push_animation(animate);

Check warning on line 240 in core/src/animation/stagger.rs

View check run for this annotation

Codecov / codecov/patch

core/src/animation/stagger.rs#L240

Added line #L240 was not covered by tests
stagger.write().push_state(
map_writer!($mock_box.size),
Size::new(200., 200.),
Expand Down
Loading

0 comments on commit 542f21a

Please sign in to comment.