Skip to content

Commit

Permalink
Fixed Metal backend with high_dpi = false
Browse files Browse the repository at this point in the history
  • Loading branch information
birhburh authored and not-fl3 committed Jun 13, 2024
1 parent 95108a5 commit f6780f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/native/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ impl MacosDisplay {
let dpi_scale: f64 = msg_send![self.window, backingScaleFactor];
d.dpi_scale = dpi_scale as f32;
} else {
d.dpi_scale = 1.0;
let bounds: NSRect = msg_send![self.view, bounds];
let backing_size: NSSize = msg_send![self.view, convertSizeToBacking: NSSize {width: bounds.size.width, height: bounds.size.height}];

d.dpi_scale = (backing_size.width / bounds.size.width) as f32;
}

let bounds: NSRect = msg_send![self.view, bounds];
Expand Down

0 comments on commit f6780f1

Please sign in to comment.