Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.

Commit c3e8434

Browse files
committed
Fix scaling of get_size on Windows
Progress toward #26
1 parent 122e37a commit c3e8434

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/windows/window.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,7 @@ impl WindowHandle {
16981698
self.defer(DeferredOp::SetSize(size));
16991699
}
17001700

1701-
// Gets the size of the window in pixels
1701+
// Gets the size of the window in device points
17021702
pub fn get_size(&self) -> Size {
17031703
if let Some(w) = self.state.upgrade() {
17041704
let hwnd = w.hwnd.get();
@@ -1717,7 +1717,7 @@ impl WindowHandle {
17171717
};
17181718
let width = rect.right - rect.left;
17191719
let height = rect.bottom - rect.top;
1720-
return Size::new(width as f64, height as f64);
1720+
return Size::new(width as f64, height as f64).to_dp(w.scale.get());
17211721
}
17221722
}
17231723
Size::new(0.0, 0.0)

0 commit comments

Comments
 (0)