Report cursor size to InputMethod
Co-authored-by: dcz-self <dcz-self@users.noreply.github.com>
This commit is contained in:
parent
e163333161
commit
d22da7d261
5 changed files with 31 additions and 20 deletions
|
|
@ -785,10 +785,10 @@ where
|
|||
);
|
||||
|
||||
if !had_input_method
|
||||
&& let InputMethod::Enabled { position, .. } =
|
||||
&& let InputMethod::Enabled { cursor, .. } =
|
||||
shell.input_method_mut()
|
||||
{
|
||||
*position = *position - translation;
|
||||
*cursor = *cursor - translation;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -365,11 +365,13 @@ where
|
|||
self.text_size.unwrap_or_else(|| renderer.default_size()),
|
||||
);
|
||||
|
||||
let position =
|
||||
cursor + translation + Vector::new(0.0, f32::from(line_height));
|
||||
let position = cursor + translation;
|
||||
|
||||
InputMethod::Enabled {
|
||||
position,
|
||||
cursor: Rectangle::new(
|
||||
position,
|
||||
Size::new(0.0, f32::from(line_height)),
|
||||
),
|
||||
purpose: input_method::Purpose::Normal,
|
||||
preedit: state.preedit.as_ref().map(input_method::Preedit::as_ref),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -428,7 +428,10 @@ where
|
|||
+ alignment_offset;
|
||||
|
||||
InputMethod::Enabled {
|
||||
position: Point::new(x, text_bounds.y + text_bounds.height),
|
||||
cursor: Rectangle::new(
|
||||
Point::new(x, text_bounds.y),
|
||||
Size::new(0.0, text_bounds.height),
|
||||
),
|
||||
purpose: if self.is_secure {
|
||||
input_method::Purpose::Secure
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue