Checkpoint

This commit is contained in:
Nathan Sobo
2023-10-05 14:42:29 -06:00
parent fe3ef08f39
commit 6f7c305308
13 changed files with 1190 additions and 194 deletions
+5 -8
View File
@@ -48,17 +48,14 @@ impl<S: 'static + Send + Sync> Element for Div<S> {
let Layout { order, bounds } = layout;
let style = self.computed_style();
style.paint(order, bounds, cx);
cx.stack(0, |cx| style.paint(order, bounds, cx));
// // todo!("support only one dimension being hidden")
let overflow = &style.overflow;
// if style.overflow.y != Overflow::Visible || style.overflow.x != Overflow::Visible {
// cx.clip(layout.bounds, style.corner_radii, || )
// }
style.apply_text_style(cx, |cx| {
style.apply_overflow(layout.bounds, cx, |cx| {
self.paint_children(overflow, state, cx)
cx.stack(1, |cx| {
style.apply_overflow(layout.bounds, cx, |cx| {
self.paint_children(overflow, state, cx)
})
})
})?;
self.handle_scroll(order, bounds, style.overflow.clone(), child_layouts, cx);
+3 -1
View File
@@ -73,7 +73,9 @@ impl<S: Send + Sync + 'static> Element for Img<S> {
.and_then(ResultExt::log_err)
{
let corner_radii = style.corner_radii.to_pixels(bounds.size, cx.rem_size());
cx.paint_image(bounds, corner_radii, order, data, self.grayscale)?;
cx.stack(1, |cx| {
cx.paint_image(bounds, corner_radii, order, data, self.grayscale)
})?;
} else {
cx.spawn(|_, mut cx| async move {
if image_future.await.log_err().is_some() {