windows: Simplify the logic of handle_get_min_max_info_msg
(#33102)
Release Notes: - N/A
This commit is contained in:
parent
a7bbbc0552
commit
c02e249ecb
1 changed files with 11 additions and 15 deletions
|
@ -148,22 +148,18 @@ fn handle_get_min_max_info_msg(
|
||||||
state_ptr: Rc<WindowsWindowStatePtr>,
|
state_ptr: Rc<WindowsWindowStatePtr>,
|
||||||
) -> Option<isize> {
|
) -> Option<isize> {
|
||||||
let lock = state_ptr.state.borrow();
|
let lock = state_ptr.state.borrow();
|
||||||
if let Some(min_size) = lock.min_size {
|
let min_size = lock.min_size?;
|
||||||
let scale_factor = lock.scale_factor;
|
let scale_factor = lock.scale_factor;
|
||||||
let boarder_offset = lock.border_offset;
|
let boarder_offset = lock.border_offset;
|
||||||
drop(lock);
|
drop(lock);
|
||||||
|
unsafe {
|
||||||
unsafe {
|
let minmax_info = &mut *(lparam.0 as *mut MINMAXINFO);
|
||||||
let minmax_info = &mut *(lparam.0 as *mut MINMAXINFO);
|
minmax_info.ptMinTrackSize.x =
|
||||||
minmax_info.ptMinTrackSize.x =
|
min_size.width.scale(scale_factor).0 as i32 + boarder_offset.width_offset;
|
||||||
min_size.width.scale(scale_factor).0 as i32 + boarder_offset.width_offset;
|
minmax_info.ptMinTrackSize.y =
|
||||||
minmax_info.ptMinTrackSize.y =
|
min_size.height.scale(scale_factor).0 as i32 + boarder_offset.height_offset;
|
||||||
min_size.height.scale(scale_factor).0 as i32 + boarder_offset.height_offset;
|
|
||||||
}
|
|
||||||
Some(0)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
|
Some(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_size_msg(
|
fn handle_size_msg(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue