1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Add ui.shrink_clip_rect (#5068)

This commit is contained in:
Emil Ernerfeldt
2024-09-04 17:01:41 +02:00
committed by GitHub
parent 454abf705b
commit 0b92b93233
3 changed files with 27 additions and 1 deletions

View File

@@ -215,7 +215,7 @@ impl<'l> StripLayout<'l> {
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 = max_rect.expand2(margin);
child_ui.set_clip_rect(clip_rect.intersect(child_ui.clip_rect()));
child_ui.shrink_clip_rect(clip_rect);
if !child_ui.is_sizing_pass() {
// Better to truncate (if we can), rather than hard clipping: