Document geometry

This commit is contained in:
Nathan Sobo 2023-12-06 12:28:44 -07:00
parent f833cd7c16
commit ac07e230fa
8 changed files with 1285 additions and 34 deletions

View file

@ -102,7 +102,7 @@ impl Element for Overlay {
let mut desired = self.anchor_corner.get_bounds(origin, size);
let limits = Bounds {
origin: Point::zero(),
origin: Point::default(),
size: cx.viewport_size(),
};

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@ impl TestDisplay {
id: DisplayId(1),
uuid: uuid::Uuid::new_v4(),
bounds: Bounds::from_corners(
Point::zero(),
Point::default(),
Point::new(GlobalPixels(1920.), GlobalPixels(1080.)),
),
}

View file

@ -78,7 +78,7 @@ impl PlatformWindow for TestWindow {
}
fn mouse_position(&self) -> Point<Pixels> {
Point::zero()
Point::default()
}
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
@ -223,7 +223,7 @@ impl PlatformAtlas for TestAtlas {
},
tile_id: TileId(tile_id),
bounds: crate::Bounds {
origin: Point::zero(),
origin: Point::default(),
size,
},
},

View file

@ -385,7 +385,7 @@ impl Default for Style {
min_size: Size::auto(),
max_size: Size::auto(),
aspect_ratio: None,
gap: Size::zero(),
gap: Size::default(),
// Aligment
align_items: None,
align_self: None,

View file

@ -1167,7 +1167,7 @@ impl<'a> WindowContext<'a> {
}
let available_space = cx.window.viewport_size.map(Into::into);
root_view.draw(Point::zero(), available_space, cx);
root_view.draw(Point::default(), available_space, cx);
})
});