Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Feb 16, 2024
1 parent 73b5010 commit 7f9b696
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ use display_info::DisplayInfo;
use crate::{APP_HEIGHT, APP_MOUSE_MARGIN, APP_WIDTH};

pub fn mouse_to_window_pos((x, y): (i32, i32)) -> (i32, i32) {
let Ok(DisplayInfo {width, height, x: display_x, y: display_y, .. }) = DisplayInfo::from_point(x, y) else { return (x, y); };
let Ok(DisplayInfo {
width,
height,
x: display_x,
y: display_y,
..
}) = DisplayInfo::from_point(x, y)
else {
return (x, y);
};
let app_height = *APP_HEIGHT;

let left_x = ((x - display_x) as u32) < (width / 2);
Expand Down

0 comments on commit 7f9b696

Please sign in to comment.