This commit is contained in:
Nathan Sobo 2023-08-15 09:26:16 -06:00
parent f9858445b8
commit 0fe457020b
8 changed files with 199 additions and 107 deletions

View file

@ -1264,17 +1264,17 @@ impl LayoutEngine {
Ok(())
}
pub fn computed_layout(&mut self, node: LayoutNodeId) -> Result<Layout> {
pub fn computed_layout(&mut self, node: LayoutNodeId) -> Result<EngineLayout> {
Ok(self.0.layout(node)?.into())
}
}
pub struct Layout {
pub struct EngineLayout {
pub bounds: RectF,
pub order: u32,
}
impl From<&taffy::tree::Layout> for Layout {
impl From<&taffy::tree::Layout> for EngineLayout {
fn from(value: &taffy::tree::Layout) -> Self {
Self {
bounds: RectF::new(

View file

@ -28,7 +28,8 @@ pub mod keymap_matcher;
pub mod platform;
pub use gpui_macros::{test, Element};
pub use window::{
Axis, Layout, LayoutEngine, LayoutNodeId, RectFExt, SizeConstraint, Vector2FExt, WindowContext,
Axis, EngineLayout, LayoutEngine, LayoutNodeId, RectFExt, SizeConstraint, Vector2FExt,
WindowContext,
};
pub use anyhow;