mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-06 01:40:45 -05:00
opt: optimize frame count when total_frame is 0
This commit is contained in:
parent
f712917159
commit
f9cff86a8a
2 changed files with 12 additions and 4 deletions
|
|
@ -235,7 +235,9 @@ void fadeout_layer_animation_next_tick(LayerSurface *l) {
|
|||
return;
|
||||
|
||||
double animation_passed =
|
||||
(double)l->animation.passed_frames / l->animation.total_frames;
|
||||
l->animation.total_frames
|
||||
? (double)l->animation.passed_frames / l->animation.total_frames
|
||||
: 1.0;
|
||||
int type = l->animation.action = l->animation.action;
|
||||
double factor = find_animation_curve_at(animation_passed, type);
|
||||
unsigned int width =
|
||||
|
|
@ -294,7 +296,9 @@ void layer_animation_next_tick(LayerSurface *l) {
|
|||
return;
|
||||
|
||||
double animation_passed =
|
||||
(double)l->animation.passed_frames / l->animation.total_frames;
|
||||
l->animation.total_frames
|
||||
? (double)l->animation.passed_frames / l->animation.total_frames
|
||||
: 1.0;
|
||||
|
||||
int type = l->animation.action == NONE ? MOVE : l->animation.action;
|
||||
double factor = find_animation_curve_at(animation_passed, type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue