Bug Fix: Allocate Frame outer margins (#2089)
This commit is contained in:
parent
2ee9ab3151
commit
2dca01ecd5
1 changed files with 8 additions and 1 deletions
|
@ -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…
Reference in a new issue