opt: optimize frame count when total_frame is 0
This commit is contained in:
@@ -618,7 +618,9 @@ void fadeout_client_animation_next_tick(Client *c) {
|
|||||||
BufferData buffer_data;
|
BufferData buffer_data;
|
||||||
|
|
||||||
double animation_passed =
|
double animation_passed =
|
||||||
(double)c->animation.passed_frames / c->animation.total_frames;
|
c->animation.total_frames
|
||||||
|
? (double)c->animation.passed_frames / c->animation.total_frames
|
||||||
|
: 1.0;
|
||||||
int type = c->animation.action = c->animation.action;
|
int type = c->animation.action = c->animation.action;
|
||||||
double factor = find_animation_curve_at(animation_passed, type);
|
double factor = find_animation_curve_at(animation_passed, type);
|
||||||
unsigned int width =
|
unsigned int width =
|
||||||
@@ -674,7 +676,9 @@ void fadeout_client_animation_next_tick(Client *c) {
|
|||||||
|
|
||||||
void client_animation_next_tick(Client *c) {
|
void client_animation_next_tick(Client *c) {
|
||||||
double animation_passed =
|
double animation_passed =
|
||||||
(double)c->animation.passed_frames / c->animation.total_frames;
|
c->animation.total_frames
|
||||||
|
? (double)c->animation.passed_frames / c->animation.total_frames
|
||||||
|
: 1.0;
|
||||||
|
|
||||||
int type = c->animation.action == NONE ? MOVE : c->animation.action;
|
int type = c->animation.action == NONE ? MOVE : c->animation.action;
|
||||||
double factor = find_animation_curve_at(animation_passed, type);
|
double factor = find_animation_curve_at(animation_passed, type);
|
||||||
|
|||||||
@@ -235,7 +235,9 @@ void fadeout_layer_animation_next_tick(LayerSurface *l) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
double animation_passed =
|
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;
|
int type = l->animation.action = l->animation.action;
|
||||||
double factor = find_animation_curve_at(animation_passed, type);
|
double factor = find_animation_curve_at(animation_passed, type);
|
||||||
unsigned int width =
|
unsigned int width =
|
||||||
@@ -294,7 +296,9 @@ void layer_animation_next_tick(LayerSurface *l) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
double animation_passed =
|
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;
|
int type = l->animation.action == NONE ? MOVE : l->animation.action;
|
||||||
double factor = find_animation_curve_at(animation_passed, type);
|
double factor = find_animation_curve_at(animation_passed, type);
|
||||||
|
|||||||
Reference in New Issue
Block a user