aboutsummaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-04-15 09:13:54 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-04-25 02:00:18 -0700
commitdbe0a9e2931b17ac113bdc90d610cf9a28029629 (patch)
tree71f608a4a7fe1aaa4160c9efd36a7a04d2abc71f /src/layout
parentd3a79faeecc5f399b616e2b1a21a48f7b26cd720 (diff)
downloadniri-dbe0a9e2931b17ac113bdc90d610cf9a28029629.tar.gz
niri-dbe0a9e2931b17ac113bdc90d610cf9a28029629.tar.bz2
niri-dbe0a9e2931b17ac113bdc90d610cf9a28029629.zip
layout/tab_indicator: Use round_max1 where appropriate
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/tab_indicator.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/layout/tab_indicator.rs b/src/layout/tab_indicator.rs
index 182934ad..08bde63c 100644
--- a/src/layout/tab_indicator.rs
+++ b/src/layout/tab_indicator.rs
@@ -10,7 +10,9 @@ use crate::animation::{Animation, Clock};
use crate::niri_render_elements;
use crate::render_helpers::border::BorderRenderElement;
use crate::render_helpers::renderer::NiriRenderer;
-use crate::utils::{floor_logical_in_physical_max1, round_logical_in_physical};
+use crate::utils::{
+ floor_logical_in_physical_max1, round_logical_in_physical, round_logical_in_physical_max1,
+};
#[derive(Debug)]
pub struct TabIndicator {
@@ -77,12 +79,13 @@ impl TabIndicator {
scale: f64,
) -> impl Iterator<Item = Rectangle<f64, Logical>> {
let round = |logical: f64| round_logical_in_physical(scale, logical);
+ let round_max1 = |logical: f64| round_logical_in_physical_max1(scale, logical);
let progress = self.open_anim.as_ref().map_or(1., |a| a.value().max(0.));
- let width = round(self.config.width.0);
- let gap = round(self.config.gap.0);
- let gaps_between = round(self.config.gaps_between_tabs.0);
+ let width = round_max1(self.config.width.0);
+ let gap = round_max1(self.config.gap.0);
+ let gaps_between = round_max1(self.config.gaps_between_tabs.0);
let position = self.config.position;
let side = match position {