Skip to content

Commit 7db57b2

Browse files
committed
Fix warp mouse coordinates with scaled windows on Windows
1 parent daf6cbd commit 7db57b2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

plugin-canvas/src/platform/win32/window.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,11 @@ impl OsWindowInterface for OsWindow {
293293
}
294294

295295
fn warp_mouse(&self, position: LogicalPosition) {
296-
let scale = self.os_scale();
297-
let physical_position = position.to_physical(scale);
296+
let scale = self.scale();
298297

299298
let mut point = POINT {
300-
x: physical_position.x,
301-
y: physical_position.y,
299+
x: (position.x * scale) as _,
300+
y: (position.y * scale) as _,
302301
};
303302

304303
unsafe {

0 commit comments

Comments
 (0)