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

Animations + Widget Repackaging #17

Closed
wants to merge 2 commits into from
Closed

Animations + Widget Repackaging #17

wants to merge 2 commits into from

Conversation

13r0ck
Copy link
Member

@13r0ck 13r0ck commented Nov 12, 2022

Working Implementation: iced-rs/iced#1543

Rendered

@13r0ck 13r0ck mentioned this pull request Nov 12, 2022
@13r0ck
Copy link
Member Author

13r0ck commented Nov 14, 2022

Would it be more appropriate if we made Widget Repackaging an operation?

@jackpot51 would Widget Repackaging be viable for your vision of caching for an advanced text rendering widget?

@13r0ck 13r0ck mentioned this pull request Nov 16, 2022
@13r0ck
Copy link
Member Author

13r0ck commented Nov 21, 2022

Alternative options:
A) Rather than widget-repackaging we could make each widget's state available in the layout step, and the calculations could be done there. The pros of this being (1) that the widget repackaging step can be skipped all together, (2) this should be able to allow for theme animations, as state is available in draw with the stylesheet so the widget theme could be interpolated there. Cons being that (1) the animation might need to be cloned in an rc, we would still need an animation hash comparison when diffing widget state.

B) Rather than animation being a type with a keyframe trait, iced_animations could just be a bunch of helper functions that take a 2 dimensional Vec of a type similar to:

enum Animatable {
    Lenght(Lenght),
    Usize(usize),
    f32(f32),
    ~~SNIP~~~
}

then each widget could still create a keyframe type for developer convenience so that each stored value in the array of the widget's keyframe can still be named ( i.e .width)

I actually lean towards both of these being better than what is currently in this RFC, but I would really like some input before I continue development of this :)

Edit: after iced-rs/iced#1563 makes (A) easier

@13r0ck
Copy link
Member Author

13r0ck commented Jan 26, 2023

Closing in favor of https://github.com/pop-os/cosmic-time

@13r0ck 13r0ck closed this Jan 26, 2023
@13r0ck 13r0ck deleted the animations-widget-repackaging branch January 26, 2023 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant