mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 09:25:01 +00:00
Fix stack_view when screen is smaller than content
This commit is contained in:
parent
1fcca9b3a9
commit
493ed1322c
@ -44,7 +44,9 @@ impl View for StackView {
|
||||
match self.layers.last() {
|
||||
None => (),
|
||||
Some(v) => {
|
||||
let offset = (printer.size - v.size) / 2;
|
||||
// Center the view
|
||||
let view_size = Vec2::min(printer.size, v.size);
|
||||
let offset = (printer.size - view_size) / 2;
|
||||
v.view.draw(&printer.sub_printer(offset, v.size));
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user