Fix IME
window position with scale factor greater than 1.0 (#9637)
In #9456 I forgot to handle this... Release Notes: - N/A
This commit is contained in:
parent
e1d1d575c3
commit
d89905fc3d
1 changed files with 5 additions and 2 deletions
|
@ -689,11 +689,14 @@ impl WindowsWindowInner {
|
||||||
let caret_range = input_handler.selected_text_range().unwrap();
|
let caret_range = input_handler.selected_text_range().unwrap();
|
||||||
let caret_position = input_handler.bounds_for_range(caret_range).unwrap();
|
let caret_position = input_handler.bounds_for_range(caret_range).unwrap();
|
||||||
self.input_handler.set(Some(input_handler));
|
self.input_handler.set(Some(input_handler));
|
||||||
|
let scale_factor = self.scale_factor.get();
|
||||||
let config = CANDIDATEFORM {
|
let config = CANDIDATEFORM {
|
||||||
dwStyle: CFS_CANDIDATEPOS,
|
dwStyle: CFS_CANDIDATEPOS,
|
||||||
|
// logical to physical
|
||||||
ptCurrentPos: POINT {
|
ptCurrentPos: POINT {
|
||||||
x: caret_position.origin.x.0 as i32,
|
x: (caret_position.origin.x.0 * scale_factor) as i32,
|
||||||
y: caret_position.origin.y.0 as i32 + (caret_position.size.height.0 as i32 / 2),
|
y: (caret_position.origin.y.0 * scale_factor) as i32
|
||||||
|
+ ((caret_position.size.height.0 * scale_factor) as i32 / 2),
|
||||||
},
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue