Checkpoint

This commit is contained in:
Nathan Sobo 2023-08-25 23:15:58 -06:00
parent 8ad736da8d
commit 3bebfbcd50
10 changed files with 161 additions and 156 deletions

View file

@ -1304,8 +1304,8 @@ impl LayoutEngine {
Ok(())
}
pub fn computed_layout(&mut self, node: LayoutId) -> Result<EngineLayout> {
Ok(EngineLayout::from(self.0.layout(node)?))
pub fn computed_layout(&mut self, node: LayoutId) -> Result<Layout> {
Ok(Layout::from(self.0.layout(node)?))
}
}
@ -1329,7 +1329,7 @@ where
}
#[derive(Debug, Clone, Default)]
pub struct EngineLayout {
pub struct Layout {
pub bounds: RectF,
pub order: u32,
}
@ -1365,7 +1365,7 @@ impl From<taffy::prelude::AvailableSpace> for AvailableSpace {
}
}
impl From<&taffy::tree::Layout> for EngineLayout {
impl From<&taffy::tree::Layout> for Layout {
fn from(value: &taffy::tree::Layout) -> Self {
Self {
bounds: RectF::new(

View file

@ -7,8 +7,8 @@ pub use assets::*;
pub mod elements;
pub mod font_cache;
mod image_data;
pub use taffy;
pub use crate::image_data::ImageData;
pub use taffy;
pub mod views;
pub use font_cache::FontCache;
mod clipboard;
@ -29,8 +29,7 @@ pub mod keymap_matcher;
pub mod platform;
pub use gpui_macros::{test, Element};
pub use window::{
Axis, EngineLayout, LayoutEngine, LayoutId, RectFExt, SizeConstraint, Vector2FExt,
WindowContext,
Axis, Layout, LayoutEngine, LayoutId, RectFExt, SizeConstraint, Vector2FExt, WindowContext,
};
pub use anyhow;