gpui: Fix pre-edit position after applying scale factor (#18214)

before:

![image](https://github.com/user-attachments/assets/20590089-3333-4ca8-a371-b07acfbe43f9)

after:

![image](https://github.com/user-attachments/assets/2d25623e-0602-4d24-b563-64e1d2ec3492)

Release Notes:

- N/A
This commit is contained in:
wannacu 2024-09-30 18:57:59 +08:00 committed by GitHub
parent 65f6a7e5bc
commit 8ae74bc6df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 31 additions and 21 deletions

View file

@ -3610,7 +3610,9 @@ impl<'a> WindowContext<'a> {
self.on_next_frame(|cx| {
if let Some(mut input_handler) = cx.window.platform_window.take_input_handler() {
if let Some(bounds) = input_handler.selected_bounds(cx) {
cx.window.platform_window.update_ime_position(bounds);
cx.window
.platform_window
.update_ime_position(bounds.scale(cx.scale_factor()));
}
cx.window.platform_window.set_input_handler(input_handler);
}