1
0
Fork 0

Round size before resizing on macOS

Otherwise the top row of pixels may contain flickering artifacts.
This commit is contained in:
Robbert van der Helm 2022-12-02 20:02:32 +01:00
parent bc2b2bd458
commit d7a8c52d23

View file

@ -320,7 +320,9 @@ impl Window {
}
pub fn resize(&mut self, size: Size) {
let size = NSSize::new(size.width, size.height);
// NOTE: macOS gives you a personal rave if you pass in fractional pixels here. Even though
// the size is in fractional pixels.
let size = NSSize::new(size.width.round(), size.height.round());
unsafe { NSView::setFrameSize(self.ns_view, size) };
unsafe {