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