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

@ -2,11 +2,12 @@ use gpui::{
color::Color,
fonts::{Properties, Weight},
text_layout::RunStyle,
DebugContext, Element as _, Quad,
DebugContext, Element as _, MeasurementContext, Quad,
};
use log::LevelFilter;
use pathfinder_geometry::rect::RectF;
use simplelog::SimpleLogger;
use std::ops::Range;
fn main() {
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
@ -112,6 +113,18 @@ impl gpui::Element for TextElement {
false
}
fn rect_for_text_range(
&self,
_: Range<usize>,
_: RectF,
_: RectF,
_: &Self::LayoutState,
_: &Self::PaintState,
_: &MeasurementContext,
) -> Option<RectF> {
None
}
fn debug(
&self,
_: RectF,