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

Commit

Permalink
Fix scaling of get_size on Windows
Browse files Browse the repository at this point in the history
Progress toward #26
  • Loading branch information
raphlinus committed Nov 23, 2022
1 parent 122e37a commit c3e8434
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,7 @@ impl WindowHandle {
self.defer(DeferredOp::SetSize(size));
}

// Gets the size of the window in pixels
// Gets the size of the window in device points
pub fn get_size(&self) -> Size {
if let Some(w) = self.state.upgrade() {
let hwnd = w.hwnd.get();
Expand All @@ -1717,7 +1717,7 @@ impl WindowHandle {
};
let width = rect.right - rect.left;
let height = rect.bottom - rect.top;
return Size::new(width as f64, height as f64);
return Size::new(width as f64, height as f64).to_dp(w.scale.get());
}
}
Size::new(0.0, 0.0)
Expand Down

0 comments on commit c3e8434

Please sign in to comment.