Consider layer transform when positioning text agent (#4319)
When positioning the text agent, the layer transform was not being considered. This not only caused issues with IME input positioning but also layout shifts if the text agent was off-screen. Before  After 
This commit is contained in:
parent
2342788973
commit
78d95f430b
|
|
@ -700,11 +700,15 @@ impl<'t> TextEdit<'t> {
|
|||
);
|
||||
}
|
||||
|
||||
// For IME, so only set it when text is editable and visible!
|
||||
// Set IME output (in screen coords) when text is editable and visible
|
||||
let transform = ui
|
||||
.memory(|m| m.layer_transforms.get(&ui.layer_id()).cloned())
|
||||
.unwrap_or_default();
|
||||
|
||||
ui.ctx().output_mut(|o| {
|
||||
o.ime = Some(crate::output::IMEOutput {
|
||||
rect,
|
||||
cursor_rect: primary_cursor_rect,
|
||||
rect: transform * rect,
|
||||
cursor_rect: transform * primary_cursor_rect,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue