mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
layout/tab_indicator: Use round_max1 where appropriate
This commit is contained in:
@@ -10,7 +10,9 @@ use crate::animation::{Animation, Clock};
|
|||||||
use crate::niri_render_elements;
|
use crate::niri_render_elements;
|
||||||
use crate::render_helpers::border::BorderRenderElement;
|
use crate::render_helpers::border::BorderRenderElement;
|
||||||
use crate::render_helpers::renderer::NiriRenderer;
|
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)]
|
#[derive(Debug)]
|
||||||
pub struct TabIndicator {
|
pub struct TabIndicator {
|
||||||
@@ -77,12 +79,13 @@ impl TabIndicator {
|
|||||||
scale: f64,
|
scale: f64,
|
||||||
) -> impl Iterator<Item = Rectangle<f64, Logical>> {
|
) -> impl Iterator<Item = Rectangle<f64, Logical>> {
|
||||||
let round = |logical: f64| round_logical_in_physical(scale, 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 progress = self.open_anim.as_ref().map_or(1., |a| a.value().max(0.));
|
||||||
|
|
||||||
let width = round(self.config.width.0);
|
let width = round_max1(self.config.width.0);
|
||||||
let gap = round(self.config.gap.0);
|
let gap = round_max1(self.config.gap.0);
|
||||||
let gaps_between = round(self.config.gaps_between_tabs.0);
|
let gaps_between = round_max1(self.config.gaps_between_tabs.0);
|
||||||
|
|
||||||
let position = self.config.position;
|
let position = self.config.position;
|
||||||
let side = match position {
|
let side = match position {
|
||||||
|
|||||||
Reference in New Issue
Block a user