From 19ccb19c9673af35b2f6dbbfd1b0381f6c9ea4c7 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 17 Aug 2023 18:37:54 -0600 Subject: [PATCH] Compiling --- crates/gpui/playground/src/element.rs | 15 +++++++++++++++ crates/gpui/playground/src/frame.rs | 14 +------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/crates/gpui/playground/src/element.rs b/crates/gpui/playground/src/element.rs index 6567a692522975af368e9808f3d382667cc5a78f..ff1e6412b821b5f8bfa4b29ae646b5c64e8090d0 100644 --- a/crates/gpui/playground/src/element.rs +++ b/crates/gpui/playground/src/element.rs @@ -524,6 +524,21 @@ impl AnyElement { from_element: element_layout.as_mut(), }; + let fill_color = self + .element + .style_mut() + .fill + .as_ref() + .and_then(Fill::color) + .map(Into::into); + + cx.scene.push_quad(gpui::scene::Quad { + bounds: layout.from_engine.bounds, + background: fill_color, + border: Default::default(), + corner_radii: Default::default(), + }); + for event_handler in self.element.handlers_mut().iter().cloned() { let EngineLayout { order, bounds } = layout.from_engine; diff --git a/crates/gpui/playground/src/frame.rs b/crates/gpui/playground/src/frame.rs index 7bd5546f3dc8f356f99fafd19334be744b6ea285..56201c331b50fab2fdd3982067c670ca2b5d8357 100644 --- a/crates/gpui/playground/src/frame.rs +++ b/crates/gpui/playground/src/frame.rs @@ -2,7 +2,7 @@ use crate::{ element::{ AnyElement, Element, EventHandler, IntoElement, Layout, LayoutContext, NodeId, PaintContext, }, - style::{ElementStyle, Fill}, + style::ElementStyle, }; use anyhow::{anyhow, Result}; use gpui::LayoutNodeId; @@ -56,18 +56,6 @@ impl Element for Frame { } fn paint(&mut self, layout: Layout<()>, view: &mut V, cx: &mut PaintContext) -> Result<()> { - cx.scene.push_quad(gpui::scene::Quad { - bounds: layout.from_engine.bounds, - background: self - .style - .fill - .as_ref() - .and_then(Fill::color) - .map(Into::into), - border: Default::default(), - corner_radii: Default::default(), - }); - for child in &mut self.children { child.paint(view, cx)?; }