Position IME input according to where the selection is rendered

This commit is contained in:
Antonio Scandurra 2022-07-21 17:35:40 +02:00
parent 3c5d7e001e
commit 97ce3998ec
31 changed files with 563 additions and 27 deletions

View file

@ -6,12 +6,14 @@ use crate::{
fonts::TextStyle,
geometry::{rect::RectF, vector::Vector2F},
json::json,
presenter::MeasurementContext,
Action, Axis, ElementStateHandle, LayoutContext, PaintContext, RenderContext, SizeConstraint,
Task, View,
};
use serde::Deserialize;
use std::{
cell::{Cell, RefCell},
ops::Range,
rc::Rc,
time::Duration,
};
@ -196,6 +198,18 @@ impl Element for Tooltip {
self.child.dispatch_event(event, cx)
}
fn rect_for_text_range(
&self,
range: Range<usize>,
_: RectF,
_: RectF,
_: &Self::LayoutState,
_: &Self::PaintState,
cx: &MeasurementContext,
) -> Option<RectF> {
self.child.rect_for_text_range(range, cx)
}
fn debug(
&self,
_: RectF,