From dbe0a9e2931b17ac113bdc90d610cf9a28029629 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 15 Apr 2025 09:13:54 +0300 Subject: layout/tab_indicator: Use round_max1 where appropriate --- src/layout/tab_indicator.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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> { 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 { -- cgit