From 33688e9bcf948a92fe21e6a2f9c2c1fa0f6c3baa Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 26 Oct 2023 15:10:32 +0200 Subject: [PATCH] tiling: Fix rounding error causing overlap --- src/shell/layout/tiling/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index 1e6d0207..7af788bd 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -289,8 +289,11 @@ impl Data { .round() as i32; }); let sum: i32 = sizes.iter().sum(); - if sum < new_length { - *sizes.last_mut().unwrap() += new_length - sum; + + // fix rounding issues + if sum != new_length { + let diff = new_length - sum; + *sizes.last_mut().unwrap() += diff; } *last_geometry = geo; }