Skip to content

Commit

Permalink
cancel previous animation of color property before creating the new o…
Browse files Browse the repository at this point in the history
…ne (#404)
  • Loading branch information
FelixKratz committed Oct 3, 2023
1 parent 1a3708c commit 632c446
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ bool text_parse_sub_domain(struct text* text, FILE* rsp, struct token property,
text->highlight );
if (g_bar_manager.animator.duration > 0) {
if (text->highlight && !highlight) {
animator_cancel(&g_bar_manager.animator,
text,
(animator_function*)text_set_color);

uint32_t target = text->color.hex;
text_set_color(text, text->highlight_color.hex);

Expand All @@ -311,6 +315,10 @@ bool text_parse_sub_domain(struct text* text, FILE* rsp, struct token property,
target );
}
else if (!text->highlight && highlight) {
animator_cancel(&g_bar_manager.animator,
text,
(animator_function*)text_set_highlight_color);

uint32_t target = text->highlight_color.hex;
text_set_highlight_color(text, text->color.hex);

Expand Down

0 comments on commit 632c446

Please sign in to comment.