mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-06 07:15:53 -04:00
opt: opt buffer scale
This commit is contained in:
parent
8852dabd48
commit
ed6d71b0fc
1 changed files with 12 additions and 3 deletions
13
maomao.c
13
maomao.c
|
|
@ -4176,11 +4176,20 @@ void snap_scene_buffer_apply_size(struct wlr_scene_buffer *buffer, int sx,
|
||||||
}
|
}
|
||||||
|
|
||||||
void buffer_set_size(Client *c, animationScale data) {
|
void buffer_set_size(Client *c, animationScale data) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
only scale few previous frames in zoom in. without scale,
|
||||||
|
the surface may not fill window area at the beginning.
|
||||||
|
if scale too more frames, it can cause visual shaking
|
||||||
|
*/
|
||||||
|
double animation_passed =
|
||||||
|
(double)c->animation.passed_frames / c->animation.total_frames;
|
||||||
|
|
||||||
if (c->animation.current.width <= c->geom.width &&
|
if (c->animation.current.width <= c->geom.width &&
|
||||||
c->animation.current.height <= c->geom.height &&
|
c->animation.current.height <= c->geom.height && animation_passed > 0.1) {
|
||||||
data.height_scale == 1 && data.width_scale == 1) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->iskilling || c->animation.tagouting || c->animation.tagining ||
|
if (c->iskilling || c->animation.tagouting || c->animation.tagining ||
|
||||||
c->animation.tagouted) {
|
c->animation.tagouted) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue