nuit_core/compose/shape/styled/fill.rs
1use crate::{Shape, ShapeNode, Style};
2
3/// A shape that fills its content using a given style.
4#[derive(Debug, Clone, PartialEq)]
5pub struct Fill<T> {
6 wrapped: T,
7 style: Style,
8}
9
10impl<T> Fill<T> {
11 pub fn new(wrapped: T, style: Style) -> Self {
12 Self {
13 wrapped,
14 style,
15 }
16 }
17}
18
19impl<T> Shape for Fill<T> where T: Shape {
20 fn render(&self) -> ShapeNode {
21 ShapeNode::Fill {
22 wrapped: Box::new(self.wrapped.render()),
23 style: self.style,
24 }
25 }
26}