From 6abb94ed47e74cf6a2f410a15fd251f6363b1011 Mon Sep 17 00:00:00 2001 From: Daan Steenbergen Date: Thu, 12 Dec 2024 13:08:13 +0100 Subject: [PATCH] fix: background was not expanded for top level objects --- src/object_rendering.rs | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/object_rendering.rs b/src/object_rendering.rs index fcff9f9..47eb95a 100644 --- a/src/object_rendering.rs +++ b/src/object_rendering.rs @@ -142,31 +142,37 @@ impl RenderableObject for WorkingSet { return; } - egui::Frame::none() - .fill(pool.color_by_index(self.background_colour).convert()) - .show(ui, |ui| { - render_object_refs(ui, pool, &self.object_refs); - }); + ui.painter().rect_filled( + ui.available_rect_before_wrap(), + 0.0, + pool.color_by_index(self.background_colour).convert(), + ); + + render_object_refs(ui, pool, &self.object_refs); } } impl RenderableObject for DataMask { fn render(&self, ui: &mut egui::Ui, pool: &ObjectPool, _: Point) { - egui::Frame::none() - .fill(pool.color_by_index(self.background_colour).convert()) - .show(ui, |ui| { - render_object_refs(ui, pool, &self.object_refs); - }); + ui.painter().rect_filled( + ui.available_rect_before_wrap(), + 0.0, + pool.color_by_index(self.background_colour).convert(), + ); + + render_object_refs(ui, pool, &self.object_refs); } } impl RenderableObject for AlarmMask { fn render(&self, ui: &mut egui::Ui, pool: &ObjectPool, _: Point) { - egui::Frame::none() - .fill(pool.color_by_index(self.background_colour).convert()) - .show(ui, |ui| { - render_object_refs(ui, pool, &self.object_refs); - }); + ui.painter().rect_filled( + ui.available_rect_before_wrap(), + 0.0, + pool.color_by_index(self.background_colour).convert(), + ); + + render_object_refs(ui, pool, &self.object_refs); } }