Position IME input according to where the selection is rendered
This commit is contained in:
parent
3c5d7e001e
commit
97ce3998ec
31 changed files with 563 additions and 27 deletions
|
@ -3,6 +3,7 @@ pub mod action;
|
|||
use crate::{
|
||||
elements::ElementBox,
|
||||
executor::{self, Task},
|
||||
geometry::rect::RectF,
|
||||
keymap::{self, Binding, Keystroke},
|
||||
platform::{self, KeyDownEvent, Platform, PromptLevel, WindowOptions},
|
||||
presenter::Presenter,
|
||||
|
@ -445,6 +446,13 @@ impl InputHandler for WindowInputHandler {
|
|||
);
|
||||
});
|
||||
}
|
||||
|
||||
fn rect_for_range(&self, range_utf16: Range<usize>) -> Option<RectF> {
|
||||
let app = self.app.borrow();
|
||||
let (presenter, _) = app.presenters_and_platform_windows.get(&self.window_id)?;
|
||||
let presenter = presenter.borrow();
|
||||
presenter.rect_for_text_range(range_utf16, &app)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue