This commit is contained in:
Zhizhen He 2023-02-24 04:04:51 +08:00 committed by GitHub
parent a39f5305c5
commit 46c7240eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -28,7 +28,7 @@ void animation_setup(struct animation* animation, void* target, animator_functio
animation->final_value = final_value;
animation->update_function = update_function;
animation->target = target;
animation->seperate_bytes = false;
animation->separate_bytes = false;
animation->as_float = false;
if (interp_function == INTERP_FUNCTION_TANH) {
@ -62,7 +62,7 @@ static bool animation_update(struct animation* animation) {
/ (double)animation->duration);
int value;
if (animation->seperate_bytes) {
if (animation->separate_bytes) {
for (int i = 0; i < 4; i++) {
unsigned char byte_i = *((unsigned char*)&animation->initial_value + i);
unsigned char byte_f = *((unsigned char*)&animation->final_value + i);
@ -131,7 +131,7 @@ static void animator_calculate_offset_for_animation(struct animator* animator, s
void animator_add(struct animator* animator, struct animation* animation) {
animator_calculate_offset_for_animation(animator, animation);
animator->animations = realloc(animator->animations,
sizeof(struct animaton*)
sizeof(struct animation*)
* ++animator->animation_count);
animator->animations[animator->animation_count - 1] = animation;

View file

@ -56,7 +56,7 @@ extern struct bar_manager g_bar_manager;
t, \
g_bar_manager.animator.duration, \
g_bar_manager.animator.interp_function ); \
animation->seperate_bytes = true; \
animation->separate_bytes = true; \
animator_add(&g_bar_manager.animator, animation); \
} else { \
needs_refresh = animator_cancel(&g_bar_manager.animator, (void*)o, (bool (*)(void*, int))&f); \
@ -81,7 +81,7 @@ typedef ANIMATION_FUNCTION(animation_function);
struct animation {
bool seperate_bytes;
bool separate_bytes;
bool as_float;
bool locked;

View file

@ -167,7 +167,7 @@ static bool text_set_color(struct text* text, uint32_t color) {
return text_update_color(text);
}
static bool text_set_hightlight_color(struct text* text, uint32_t color) {
static bool text_set_highlight_color(struct text* text, uint32_t color) {
text->highlight_color = rgba_color_from_hex(color);
return text_update_color(text);
}
@ -376,9 +376,9 @@ bool text_parse_sub_domain(struct text* text, FILE* rsp, struct token property,
}
else if (!text->highlight && highlight) {
uint32_t target = hex_from_rgba_color(text->highlight_color);
text_set_hightlight_color(text, hex_from_rgba_color(text->color));
text_set_highlight_color(text, hex_from_rgba_color(text->color));
ANIMATE_BYTES(text_set_hightlight_color,
ANIMATE_BYTES(text_set_highlight_color,
text,
hex_from_rgba_color(text->highlight_color),
target );
@ -391,7 +391,7 @@ bool text_parse_sub_domain(struct text* text, FILE* rsp, struct token property,
needs_refresh = text_set_font(text, string_copy(message), false);
else if (token_equals(property, PROPERTY_HIGHLIGHT_COLOR)) {
struct token token = get_token(&message);
ANIMATE_BYTES(text_set_hightlight_color,
ANIMATE_BYTES(text_set_highlight_color,
text,
hex_from_rgba_color(text->highlight_color),
token_to_int(token) );