Don't apply a clip rect to the contents of an `Area` or `Window` (#4258)

The edges were rather arbitrarily chosen anyway, and I'm not sure who it
was supposed to help.
This commit is contained in:
Emil Ernerfeldt 2024-03-28 10:09:21 +01:00 committed by GitHub
parent 58a27882b0
commit e183655aac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 7 deletions

View File

@ -384,7 +384,7 @@ impl Area {
let layer_id = LayerId::new(self.order, self.id);
let area_rect = ctx.memory(|mem| mem.areas().get(self.id).map(|area| area.rect()));
if let Some(area_rect) = area_rect {
let clip_rect = ctx.available_rect();
let clip_rect = Rect::EVERYTHING;
let painter = Painter::new(ctx.clone(), layer_id, clip_rect);
// shrinkage: looks kinda a bad on its own
@ -437,12 +437,7 @@ impl Prepared {
.at_least(self.state.left_top_pos() + Vec2::splat(32.0)),
);
let shadow_radius = ctx.style().visuals.window_shadow.margin().sum().max_elem(); // hacky
let clip_rect_margin = ctx.style().visuals.clip_rect_margin.max(shadow_radius);
let clip_rect = Rect::from_min_max(self.state.left_top_pos(), constrain_rect.max)
.expand(clip_rect_margin)
.intersect(constrain_rect);
let clip_rect = constrain_rect; // Don't paint outside our bounds
let mut ui = Ui::new(
ctx.clone(),