mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-27 19:26:09 +00:00
parent
0bbc10706e
commit
77433e80ee
@ -31,7 +31,16 @@ impl<V: View> ViewWrapper for Panel<V> {
|
|||||||
|
|
||||||
fn wrap_draw(&self, printer: &Printer) {
|
fn wrap_draw(&self, printer: &Printer) {
|
||||||
printer.print_box((0, 0), printer.size, true);
|
printer.print_box((0, 0), printer.size, true);
|
||||||
self.view
|
self.view.draw(&printer.sub_printer((1, 1),
|
||||||
.draw(&printer.sub_printer((1, 1), printer.size - (2, 2), true));
|
printer.size - (2, 2),
|
||||||
|
true));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn wrap_layout(&mut self, size: Vec2) {
|
||||||
|
self.view.layout(if Vec2::new(2, 2).fits_in(size) {
|
||||||
|
size - (2, 2)
|
||||||
|
} else {
|
||||||
|
size
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user