mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-26 05:10:20 +00:00
perform required bit hacks to get float animations working properly
This commit is contained in:
parent
93f567f775
commit
b5e87a352a
1 changed files with 10 additions and 1 deletions
|
@ -77,13 +77,22 @@ static bool animation_update(struct animation* animation, double time_scale) {
|
||||||
} else if (animation->as_float) {
|
} else if (animation->as_float) {
|
||||||
*((float*)&value) = (1. - slider) * *(float*)&animation->initial_value
|
*((float*)&value) = (1. - slider) * *(float*)&animation->initial_value
|
||||||
+ slider * *(float*)&animation->final_value;
|
+ slider * *(float*)&animation->final_value;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
value = (1. - slider) * animation->initial_value
|
value = (1. - slider) * animation->initial_value
|
||||||
+ slider * animation->final_value;
|
+ slider * animation->final_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool needs_update;
|
||||||
|
if (animation->as_float) {
|
||||||
|
needs_update =
|
||||||
|
((bool (*)(void*, float))animation->update_function)(animation->target,
|
||||||
|
*((float*)&value) );
|
||||||
|
} else {
|
||||||
|
needs_update = animation->update_function(animation->target, value);
|
||||||
|
}
|
||||||
|
|
||||||
animation->counter += time_scale;
|
animation->counter += time_scale;
|
||||||
bool needs_update = animation->update_function(animation->target, value);
|
|
||||||
|
|
||||||
bool found_item = false;
|
bool found_item = false;
|
||||||
for (int i = 0; i < g_bar_manager.bar_item_count; i++) {
|
for (int i = 0; i < g_bar_manager.bar_item_count; i++) {
|
||||||
|
|
Loading…
Reference in a new issue