From 219ca08836adcd91f42ca24ec20f643af17dd270 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 13 Sep 2023 16:57:12 +0400 Subject: Implement minimizing view movement on changes Before this commit, windows were always left-aligned. Now, when changing focus, if the window is fully visible, the view doesn't move. If the window is not fully visible, the view is moved the minimum amount. --- src/animation.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/animation.rs') diff --git a/src/animation.rs b/src/animation.rs index 430e3516..e2b9dc39 100644 --- a/src/animation.rs +++ b/src/animation.rs @@ -46,4 +46,8 @@ impl Animation { let x = (passed / total).clamp(0., 1.); EaseOutCubic.y(x) * (self.to - self.from) + self.from } + + pub fn to(&self) -> f64 { + self.to + } } -- cgit