From 50ed438184a80545cd7aaaf2048c261c8aef6751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20G=C3=B6rtler?= Date: Fri, 13 Dec 2024 11:37:39 +0100 Subject: [PATCH] Draw solid boxes instead of stroked rectangles --- crates/viewer/re_view_graph/src/ui/draw.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/viewer/re_view_graph/src/ui/draw.rs b/crates/viewer/re_view_graph/src/ui/draw.rs index e13555b9b1ed..6fa183dd5042 100644 --- a/crates/viewer/re_view_graph/src/ui/draw.rs +++ b/crates/viewer/re_view_graph/src/ui/draw.rs @@ -181,15 +181,18 @@ fn draw_rect_label(ui: &mut Ui, label: &TextLabel, highlight: InteractionHighlig .unwrap_or_else(|| visuals.text_color()) .gamma_multiply(0.5); - frame - .stroke(stroke) - .fill(bg) - .show(ui, |ui| { - let (resp, painter) = ui.allocate_painter(galley.rect.size(), Sense::click()); - painter.rect_filled(resp.rect, 0.0, fill_color); - resp - }) - .inner + let total_size = galley.rect.size() + frame.inner_margin.sum() + frame.outer_margin.sum(); + + let (resp, painter) = ui.allocate_painter(total_size, Sense::click()); + painter.rect_filled(resp.rect, 0.0, stroke.color.gamma_multiply(0.5)); + painter.rect_filled( + resp.rect + .shrink2(frame.inner_margin.sum() + frame.outer_margin.sum()), + 0.0, + fill_color, + ); + + resp } /// Draws a node at the given position.