mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-27 11:16:03 +00:00
fix: Check for insufficient space in Panel::required_size
This commit is contained in:
parent
5f5fb4e502
commit
87676295a0
@ -20,7 +20,13 @@ impl<V: View> ViewWrapper for Panel<V> {
|
|||||||
|
|
||||||
fn wrap_required_size(&mut self, req: Vec2) -> Vec2 {
|
fn wrap_required_size(&mut self, req: Vec2) -> Vec2 {
|
||||||
// TODO: make borders conditional?
|
// TODO: make borders conditional?
|
||||||
self.view.required_size(req - (2, 2)) + (2, 2)
|
let req = if Vec2::new(2, 2).fits_in(req) {
|
||||||
|
req - (2, 2)
|
||||||
|
} else {
|
||||||
|
Vec2::zero()
|
||||||
|
};
|
||||||
|
|
||||||
|
self.view.required_size(req) + (2, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn wrap_draw(&self, printer: &Printer) {
|
fn wrap_draw(&self, printer: &Printer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user