aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-02-02 08:41:42 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-02-10 07:29:33 -0800
commita451f75917e427a4b4c7d986ce74e5a3999e563d (patch)
tree0e0f74e81e85485d5ff07f2ceb5567d4059a06d2 /src/utils
parent1515410012842c419e8bc3de717b8a51b1a0b45c (diff)
downloadniri-a451f75917e427a4b4c7d986ce74e5a3999e563d.tar.gz
niri-a451f75917e427a4b4c7d986ce74e5a3999e563d.tar.bz2
niri-a451f75917e427a4b4c7d986ce74e5a3999e563d.zip
Implement tab indicators
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs8
1 files changed, 8 insertions, 0 deletions
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<f64, Logical> {
let output_scale = output.current_scale().fractional_scale();
let output_transform = output.current_transform();