Skip to content

Commit 85559b5

Browse files
committed
fix(cocoa): set_size
1 parent 34d2045 commit 85559b5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/ui/mac/window.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ impl Window {
9494

9595
pub fn set_size(&mut self, v: Size) {
9696
let mut frame = self.wnd.frame();
97+
let ydiff = v.height - frame.size.height;
9798
frame.size = to_cgsize(v);
99+
frame.origin.y -= ydiff;
98100
self.wnd.setFrame_display(frame, true);
99101
}
100102

@@ -251,7 +253,9 @@ impl Widget {
251253

252254
pub fn set_size(&mut self, v: Size) {
253255
let mut frame = self.view.frame();
256+
let ydiff = v.height - frame.size.height;
254257
frame.size = to_cgsize(v);
258+
frame.origin.y -= ydiff;
255259
unsafe {
256260
self.view.setFrame(frame);
257261
}

0 commit comments

Comments
 (0)