Skip to content

Commit 6873cbd

Browse files
committed
fix previous commit
1 parent 2ca5cff commit 6873cbd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wlr_layout_ui/displaywidget.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def _animation_step(self):
7878
if abs(tv - cv) <= 1:
7979
setattr(r, var, tv)
8080
else:
81-
target = cv * ANIMATION_LENGTH + tv
81+
tgt = (cv * ANIMATION_LENGTH + tv) / (ANIMATION_LENGTH + 1)
8282
if cv < tv:
83-
setattr(r, var, min(tv, target / ANIMATION_LENGTH + 1))
83+
setattr(r, var, min(tv, tgt))
8484
elif cv > tv:
85-
setattr(r, var, max(tv, target / ANIMATION_LENGTH + 1))
85+
setattr(r, var, max(tv, tgt))
8686

8787
def set_position(self, x, y):
8888
self.rect.x = x

0 commit comments

Comments
 (0)