From a451f75917e427a4b4c7d986ce74e5a3999e563d Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 2 Feb 2025 08:41:42 +0300 Subject: Implement tab indicators --- src/utils/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/utils') diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 0168b83f..e43bad89 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -127,6 +127,14 @@ pub fn round_logical_in_physical_max1(scale: f64, logical: f64) -> f64 { (logical * scale).max(1.).round() / scale } +pub fn floor_logical_in_physical_max1(scale: f64, logical: f64) -> f64 { + if logical == 0. { + return 0.; + } + + (logical * scale).max(1.).floor() / scale +} + pub fn output_size(output: &Output) -> Size { let output_scale = output.current_scale().fractional_scale(); let output_transform = output.current_transform(); -- cgit