Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider layer transform when positioning text agent #4319

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions crates/egui/src/widgets/text_edit/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
}
Expand Down
Loading