layout/tab_indicator: Use round_max1 where appropriate
Browse files at this commitdbe0a9e2931b17ac113bdc90d610cf9a28029629Parent: d3a79fa1 changed file +7 -4
src/layout/tab_indicator.rsmodified+7 -4
| @@ -10,7 +10,9 @@ use crate::animation::{Animation, Clock}; | |||
| 10 | use crate::niri_render_elements; | 10 | use crate::niri_render_elements; |
| 11 | use crate::render_helpers::border::BorderRenderElement; | 11 | use crate::render_helpers::border::BorderRenderElement; |
| 12 | use crate::render_helpers::renderer::NiriRenderer; | 12 | use crate::render_helpers::renderer::NiriRenderer; |
| 13 | -use crate::utils::{floor_logical_in_physical_max1, round_logical_in_physical}; | 13 | +use crate::utils::{ |
| 14 | + floor_logical_in_physical_max1, round_logical_in_physical, round_logical_in_physical_max1, | ||
| 15 | +}; | ||
| 14 | 16 | ||
| 15 | #[derive(Debug)] | 17 | #[derive(Debug)] |
| 16 | pub struct TabIndicator { | 18 | pub struct TabIndicator { |
| @@ -77,12 +79,13 @@ impl TabIndicator { | |||
| 77 | scale: f64, | 79 | scale: f64, |
| 78 | ) -> impl Iterator<Item = Rectangle<f64, Logical>> { | 80 | ) -> impl Iterator<Item = Rectangle<f64, Logical>> { |
| 79 | let round = |logical: f64| round_logical_in_physical(scale, logical); | 81 | let round = |logical: f64| round_logical_in_physical(scale, logical); |
| 82 | + let round_max1 = |logical: f64| round_logical_in_physical_max1(scale, logical); | ||
| 80 | 83 | ||
| 81 | let progress = self.open_anim.as_ref().map_or(1., |a| a.value().max(0.)); | 84 | let progress = self.open_anim.as_ref().map_or(1., |a| a.value().max(0.)); |
| 82 | 85 | ||
| 83 | - let width = round(self.config.width.0); | 86 | + let width = round_max1(self.config.width.0); |
| 84 | - let gap = round(self.config.gap.0); | 87 | + let gap = round_max1(self.config.gap.0); |
| 85 | - let gaps_between = round(self.config.gaps_between_tabs.0); | 88 | + let gaps_between = round_max1(self.config.gaps_between_tabs.0); |
| 86 | 89 | ||
| 87 | let position = self.config.position; | 90 | let position = self.config.position; |
| 88 | let side = match position { | 91 | let side = match position { |