Checkpoint

This commit is contained in:
Nathan Sobo
2023-09-08 16:25:10 -06:00
parent 362b1a44be
commit ebf8b32811
49 changed files with 491 additions and 627 deletions
+3 -3
View File
@@ -88,7 +88,7 @@ impl<V: 'static> Element<V> for Div<V> {
// TODO: Support only one dimension being hidden
let mut pop_layer = false;
if style.overflow.y != Overflow::Visible || style.overflow.x != Overflow::Visible {
cx.scene.push_layer(Some(bounds));
cx.scene().push_layer(Some(bounds));
pop_layer = true;
}
@@ -97,7 +97,7 @@ impl<V: 'static> Element<V> for Div<V> {
}
if pop_layer {
cx.scene.pop_layer();
cx.scene().pop_layer();
}
style.paint_foreground(bounds, cx);
@@ -221,7 +221,7 @@ impl<V: 'static> Div<V> {
let hovered = bounds.contains_point(cx.mouse_position());
if hovered {
let rem_size = cx.rem_size();
cx.scene.push_quad(scene::Quad {
cx.scene().push_quad(scene::Quad {
bounds,
background: Some(hsla(0., 0., 1., 0.05).into()),
border: gpui::Border {
+1 -1
View File
@@ -70,7 +70,7 @@ impl<V: 'static> Element<V> for Img {
.and_then(ResultExt::log_err)
{
let rem_size = cx.rem_size();
cx.scene.push_image(scene::Image {
cx.scene().push_image(scene::Image {
bounds,
border: gpui::Border {
color: style.border_color.unwrap_or_default().into(),
+1 -1
View File
@@ -63,7 +63,7 @@ impl<V: 'static> Element<V> for Svg {
color: Rgba::from(fill_color).into(),
};
cx.scene.push_icon(icon);
cx.scene().push_icon(icon);
}
}
}
+1 -7
View File
@@ -92,13 +92,7 @@ impl<V: 'static> Element<V> for Text {
// TODO: We haven't added visible bounds to the new element system yet, so this is a placeholder.
let visible_bounds = bounds;
line.paint(
cx.scene,
bounds.origin(),
visible_bounds,
line_height,
cx.legacy_cx,
);
line.paint(bounds.origin(), visible_bounds, line_height, cx.legacy_cx);
}
}