Skip to content

Commit

Permalink
fix: fixed thumb window size on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone committed May 6, 2023
1 parent 33ba94b commit 911047e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ fn main() {
let LogicalPosition { x: x1, y: y1 } =
position.to_logical::<i32>(scale_factor);
let LogicalSize {
width: w,
height: h,
width: mut w,
height: mut h,
} = size.to_logical::<i32>(scale_factor);
if cfg!(target_os = "windows") {
w = (20.0 as f64 * scale_factor) as i32;
h = (20.0 as f64 * scale_factor) as i32;
}
let (x2, y2) = (x1 + w, y1 + h);
let res = x >= x1 && x <= x2 && y >= y1 && y <= y2;
res
Expand Down

0 comments on commit 911047e

Please sign in to comment.