Skip to content

Commit

Permalink
Draw solid boxes instead of stroked rectangles
Browse files Browse the repository at this point in the history
  • Loading branch information
grtlr committed Dec 13, 2024
1 parent f8e0110 commit 50ed438
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions crates/viewer/re_view_graph/src/ui/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 50ed438

Please sign in to comment.