aboutsummaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-03-01 08:09:03 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-03-01 08:09:03 +0400
commit6e5426ef225f5720a97cf7e2def25132bfc2cf0c (patch)
treef3cc1c25d3f8755af639c572f80c759208e1b42b /src/layout
parent202406aadfb710a4c6272c08455007e1a08f800b (diff)
downloadniri-6e5426ef225f5720a97cf7e2def25132bfc2cf0c.tar.gz
niri-6e5426ef225f5720a97cf7e2def25132bfc2cf0c.tar.bz2
niri-6e5426ef225f5720a97cf7e2def25132bfc2cf0c.zip
Fix center-column regression
Mistake introduced along with the horizontal gesture.
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/workspace.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs
index 34867755..c0b04896 100644
--- a/src/layout/workspace.rs
+++ b/src/layout/workspace.rs
@@ -171,15 +171,6 @@ impl OutputId {
}
}
-impl ViewOffsetAdjustment {
- pub fn current_view_offset(&self) -> f64 {
- match self {
- ViewOffsetAdjustment::Animation(anim) => anim.value(),
- ViewOffsetAdjustment::Gesture(gesture) => gesture.current_view_offset,
- }
- }
-}
-
impl ColumnWidth {
fn resolve(self, options: &Options, view_width: i32) -> i32 {
match self {
@@ -401,8 +392,8 @@ impl<W: LayoutElement> Workspace<W> {
let new_col_x = self.column_x(idx);
- let final_x = if let Some(adj) = &self.view_offset_adj {
- current_x - self.view_offset + adj.current_view_offset().round() as i32
+ let final_x = if let Some(ViewOffsetAdjustment::Animation(anim)) = &self.view_offset_adj {
+ current_x - self.view_offset + anim.to().round() as i32
} else {
current_x
};