use Printer; use view::{View, ViewWrapper}; /// Wrapper view that fills the background. /// /// Used as layer in the [`StackView`]. /// /// [`StackView`]: struct.StackView.html #[derive(Debug)] pub struct Layer { view: T, } impl Layer { /// Wraps the given view. pub fn new(view: T) -> Self { Layer { view: view } } inner_getters!(self.view: T); } impl ViewWrapper for Layer { wrap_impl!(self.view: T); fn wrap_draw(&self, printer: &Printer) { for y in 0..printer.size.y { printer.print_hline((0, y), printer.size.x, " "); } self.view.draw(printer); } }