mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 12:19:28 +00:00
Query rect_for_text_range
on focused view instead of root element
This was causing IME input to be drawn in the wrong place when there were splits or panels in the window.
This commit is contained in:
parent
a89f3ed445
commit
c872f581d1
2 changed files with 4 additions and 4 deletions
|
@ -965,10 +965,10 @@ impl<'a> WindowContext<'a> {
|
|||
}
|
||||
|
||||
pub fn rect_for_text_range(&self, range_utf16: Range<usize>) -> Option<RectF> {
|
||||
let root_view_id = self.window.root_view().id();
|
||||
let focused_view_id = self.window.focused_view_id?;
|
||||
self.window
|
||||
.rendered_views
|
||||
.get(&root_view_id)?
|
||||
.get(&focused_view_id)?
|
||||
.rect_for_text_range(range_utf16, self)
|
||||
.log_err()
|
||||
.flatten()
|
||||
|
|
|
@ -84,8 +84,8 @@ impl InputHandler for WindowInputHandler {
|
|||
|
||||
fn rect_for_range(&self, range_utf16: Range<usize>) -> Option<RectF> {
|
||||
self.app
|
||||
.borrow_mut()
|
||||
.update_window(self.window_id, |cx| cx.rect_for_text_range(range_utf16))
|
||||
.borrow()
|
||||
.read_window(self.window_id, |cx| cx.rect_for_text_range(range_utf16))
|
||||
.flatten()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue