egui_extras Table/Strip: less aggressive cell clipping

This commit is contained in:
Emil Ernerfeldt 2022-04-11 10:55:52 +02:00
parent 917f9e1768
commit e97241861e

View file

@ -142,7 +142,10 @@ impl<'l> StripLayout<'l> {
let mut child_ui = self.ui.child_ui(rect, self.cell_layout);
if self.clip {
child_ui.set_clip_rect(child_ui.clip_rect().intersect(rect));
let margin = egui::Vec2::splat(self.ui.visuals().clip_rect_margin);
let margin = margin.min(0.5 * self.ui.spacing().item_spacing);
let clip_rect = rect.expand2(margin);
child_ui.set_clip_rect(clip_rect.intersect(child_ui.clip_rect()));
}
add_contents(&mut child_ui);