diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-13 16:57:12 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-13 16:57:12 +0400 |
| commit | 219ca08836adcd91f42ca24ec20f643af17dd270 (patch) | |
| tree | 3395f5dda3bcd3a2be755bdbc401a43a8a45d2b9 /src/animation.rs | |
| parent | c8b85b83c7d1db9ae4834fa95223cfb8b13e276a (diff) | |
| download | niri-219ca08836adcd91f42ca24ec20f643af17dd270.tar.gz niri-219ca08836adcd91f42ca24ec20f643af17dd270.tar.bz2 niri-219ca08836adcd91f42ca24ec20f643af17dd270.zip | |
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.
Diffstat (limited to 'src/animation.rs')
| -rw-r--r-- | src/animation.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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 + } } |
