aboutsummaryrefslogtreecommitdiff
path: root/src/utils/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/mod.rs')
-rw-r--r--src/utils/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index df21ffdb..e9e56bcf 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -40,6 +40,10 @@ pub fn center(rect: Rectangle<i32, Logical>) -> Point<i32, Logical> {
rect.loc + rect.size.downscale(2).to_point()
}
+pub fn center_f64(rect: Rectangle<f64, Logical>) -> Point<f64, Logical> {
+ rect.loc + rect.size.downscale(2.0).to_point()
+}
+
pub fn output_size(output: &Output) -> Size<i32, Logical> {
let output_scale = output.current_scale().integer_scale();
let output_transform = output.current_transform();