stuff for ime positioning
This commit is contained in:
@@ -3,8 +3,8 @@ use image::DynamicImage;
|
||||
use crate::{
|
||||
core::{TextEdit, TextEditCtx},
|
||||
layout::{
|
||||
IdLike, PainterCtx, PainterData, StaticWidgetId, TextureHandle, Vec2, Widget, WidgetId,
|
||||
WidgetLike,
|
||||
IdLike, PainterCtx, PainterData, PixelRegion, StaticWidgetId, TextureHandle, Vec2, Widget,
|
||||
WidgetId, WidgetLike,
|
||||
},
|
||||
util::Id,
|
||||
};
|
||||
@@ -179,6 +179,11 @@ impl Ui {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn window_region<W>(&self, id: &impl IdLike<W>) -> Option<PixelRegion> {
|
||||
let region = self.data.active.get(&id.id())?.region;
|
||||
Some(region.to_screen(self.data.output_size))
|
||||
}
|
||||
|
||||
pub fn debug(&self, label: &str) {
|
||||
for (id, inst) in &self.data.active {
|
||||
let l = &self.data.widgets.data(id).unwrap().label;
|
||||
|
||||
Reference in New Issue
Block a user