From 741bee461cbdaf0236eaa55dc86dc84b01613128 Mon Sep 17 00:00:00 2001 From: FluxTape Date: Mon, 26 Feb 2024 18:47:46 +0100 Subject: Implement warp-mouse-to-focus --- src/utils/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/utils/mod.rs') 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) -> Point { rect.loc + rect.size.downscale(2).to_point() } +pub fn center_f64(rect: Rectangle) -> Point { + rect.loc + rect.size.downscale(2.0).to_point() +} + pub fn output_size(output: &Output) -> Size { let output_scale = output.current_scale().integer_scale(); let output_transform = output.current_transform(); -- cgit