opt: optimize code struct

This commit is contained in:
DreamMaoMao 2025-07-15 16:28:03 +08:00
parent 03a436dee5
commit 03d3f992f2

View file

@ -374,14 +374,7 @@ void client_apply_clip(Client *c, float factor) {
bool should_render_client_surface = false;
struct ivec2 offset;
animationScale scale_data;
float percent =
c->animation.action == OPEN && animation_fade_in && !c->nofadein
? (double)c->animation.passed_frames / c->animation.total_frames
: 1.0;
float opacity = c->isfullscreen ? 1
: c == selmon->sel ? c->focused_opacity
: c->unfocused_opacity;
float opacity, percent;
int bw = (int)c->bw;
@ -413,6 +406,14 @@ void client_apply_clip(Client *c, float factor) {
return;
}
percent =
c->animation.action == OPEN && animation_fade_in && !c->nofadein
? (double)c->animation.passed_frames / c->animation.total_frames
: 1.0;
opacity = c->isfullscreen ? 1
: c == selmon->sel ? c->focused_opacity
: c->unfocused_opacity;
// 获取窗口动画实时位置矩形
unsigned int width, height;
client_actual_size(c, &width, &height);