mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 11:21:30 +11:00
parent
0df7c35058
commit
75a25ce898
|
@ -497,25 +497,6 @@ impl Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let new_width = width * scale_factor as usize;
|
|
||||||
let new_height = height * scale_factor as usize;
|
|
||||||
|
|
||||||
let mut rect = windef::RECT {
|
|
||||||
left: 0,
|
|
||||||
right: new_width as ntdef::LONG,
|
|
||||||
top: 0,
|
|
||||||
bottom: new_height as ntdef::LONG,
|
|
||||||
};
|
|
||||||
|
|
||||||
winuser::AdjustWindowRect(
|
|
||||||
&mut rect,
|
|
||||||
winuser::WS_POPUP | winuser::WS_SYSMENU | winuser::WS_CAPTION,
|
|
||||||
0,
|
|
||||||
);
|
|
||||||
|
|
||||||
rect.right -= rect.left;
|
|
||||||
rect.bottom -= rect.top;
|
|
||||||
|
|
||||||
let window_name = to_wstring(name);
|
let window_name = to_wstring(name);
|
||||||
|
|
||||||
let mut flags = 0;
|
let mut flags = 0;
|
||||||
|
@ -545,6 +526,21 @@ impl Window {
|
||||||
flags = winuser::WS_VISIBLE | winuser::WS_POPUP;
|
flags = winuser::WS_VISIBLE | winuser::WS_POPUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let new_width = width * scale_factor as usize;
|
||||||
|
let new_height = height * scale_factor as usize;
|
||||||
|
|
||||||
|
let mut rect = windef::RECT {
|
||||||
|
left: 0,
|
||||||
|
right: new_width as ntdef::LONG,
|
||||||
|
top: 0,
|
||||||
|
bottom: new_height as ntdef::LONG,
|
||||||
|
};
|
||||||
|
|
||||||
|
winuser::AdjustWindowRect(&mut rect, flags, 0);
|
||||||
|
|
||||||
|
rect.right -= rect.left;
|
||||||
|
rect.bottom -= rect.top;
|
||||||
|
|
||||||
let handle = winuser::CreateWindowExW(
|
let handle = winuser::CreateWindowExW(
|
||||||
0,
|
0,
|
||||||
class_name.as_ptr(),
|
class_name.as_ptr(),
|
||||||
|
|
Loading…
Reference in a new issue