WIP
This commit is contained in:
parent
196946cbb6
commit
b6110fed9e
2 changed files with 12 additions and 2 deletions
|
@ -1528,6 +1528,11 @@ mod tests {
|
|||
});
|
||||
});
|
||||
|
||||
window.update(cx, |cx| {
|
||||
let root = cx.root_element();
|
||||
dbg!(root.debug(cx).unwrap());
|
||||
});
|
||||
|
||||
// tree.layout(
|
||||
// SizeConstraint::strict(vec2f(100., 100.)),
|
||||
// &mut (),
|
||||
|
|
|
@ -923,7 +923,7 @@ impl<'a> WindowContext<'a> {
|
|||
Ok(element)
|
||||
}
|
||||
|
||||
pub(crate) fn layout(&mut self, refreshing: bool) -> Result<HashMap<usize, usize>> {
|
||||
pub fn layout(&mut self, refreshing: bool) -> Result<HashMap<usize, usize>> {
|
||||
let window_size = self.window.platform_window.content_size();
|
||||
let root_view_id = self.window.root_view().id();
|
||||
let mut rendered_root = self.window.rendered_views.remove(&root_view_id).unwrap();
|
||||
|
@ -963,7 +963,7 @@ impl<'a> WindowContext<'a> {
|
|||
Ok(old_parents)
|
||||
}
|
||||
|
||||
pub(crate) fn paint(&mut self) -> Result<Scene> {
|
||||
pub fn paint(&mut self) -> Result<Scene> {
|
||||
let window_size = self.window.platform_window.content_size();
|
||||
let scale_factor = self.window.platform_window.scale_factor();
|
||||
|
||||
|
@ -995,6 +995,11 @@ impl<'a> WindowContext<'a> {
|
|||
Ok(scene)
|
||||
}
|
||||
|
||||
pub fn root_element(&self) -> &Box<dyn AnyRootElement> {
|
||||
let view_id = self.window.root_view().id();
|
||||
self.window.rendered_views.get(&view_id).unwrap()
|
||||
}
|
||||
|
||||
pub fn rect_for_text_range(&self, range_utf16: Range<usize>) -> Option<RectF> {
|
||||
let focused_view_id = self.window.focused_view_id?;
|
||||
self.window
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue