Browse Source

egui_extras Table/Strip: less aggressive cell clipping

pull/1482/head
Emil Ernerfeldt 3 years ago
parent
commit
e97241861e
  1. 5
      egui_extras/src/layout.rs

5
egui_extras/src/layout.rs

@ -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);

Loading…
Cancel
Save