Browse Source

Bug Fix: Allocate Frame outer margins (#2089)

pull/2087/head
Paul Rouget 2 years ago
committed by GitHub
parent
commit
2dca01ecd5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      crates/egui/src/containers/frame.rs

9
crates/egui/src/containers/frame.rs

@ -244,6 +244,13 @@ impl Prepared {
rect
}
fn content_with_margin(&self) -> Rect {
let mut rect = self.content_ui.min_rect();
rect.min -= self.frame.inner_margin.left_top() + self.frame.outer_margin.left_top();
rect.max += self.frame.inner_margin.right_bottom() + self.frame.outer_margin.right_bottom();
rect
}
pub fn end(self, ui: &mut Ui) -> Response {
let paint_rect = self.paint_rect();
@ -258,6 +265,6 @@ impl Prepared {
ui.painter().set(where_to_put_background, shape);
}
ui.allocate_rect(paint_rect, Sense::hover())
ui.allocate_rect(self.content_with_margin(), Sense::hover())
}
}

Loading…
Cancel
Save