diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-08 17:08:30 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-09 12:02:35 +0200 |
| commit | 29eb13ca6214461a4b0deb63d589cd39ad6d41c2 (patch) | |
| tree | c86797d440cfcc801c87a3c64f479e39f2c068b1 /src/library/structure/table.rs | |
| parent | 712c00ecb72b67da2c0788e5d3eb4dcc6366b2a7 (diff) | |
Sum color and length into stroke
Diffstat (limited to 'src/library/structure/table.rs')
| -rw-r--r-- | src/library/structure/table.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/library/structure/table.rs b/src/library/structure/table.rs index d0ab0716..40f25749 100644 --- a/src/library/structure/table.rs +++ b/src/library/structure/table.rs @@ -19,10 +19,8 @@ impl TableNode { /// The secondary cell fill color. pub const SECONDARY: Option<Paint> = None; /// How to stroke the cells. - pub const STROKE: Option<Paint> = Some(Color::BLACK.into()); - /// The stroke's thickness. - #[property(resolve)] - pub const THICKNESS: RawLength = Length::pt(1.0).into(); + #[property(resolve, fold)] + pub const STROKE: Option<RawStroke> = Some(RawStroke::default()); /// How much to pad the cells's content. pub const PADDING: Relative<RawLength> = Length::pt(5.0).into(); @@ -48,7 +46,6 @@ impl TableNode { styles.set_opt(Self::PRIMARY, args.named("primary")?.or(fill)); styles.set_opt(Self::SECONDARY, args.named("secondary")?.or(fill)); styles.set_opt(Self::STROKE, args.named("stroke")?); - styles.set_opt(Self::THICKNESS, args.named("thickness")?); styles.set_opt(Self::PADDING, args.named("padding")?); Ok(styles) } @@ -63,8 +60,7 @@ impl Show for TableNode { let primary = styles.get(Self::PRIMARY); let secondary = styles.get(Self::SECONDARY); - let thickness = styles.get(Self::THICKNESS); - let stroke = styles.get(Self::STROKE).map(|paint| Stroke { paint, thickness }); + let stroke = styles.get(Self::STROKE).map(RawStroke::unwrap_or_default); let padding = styles.get(Self::PADDING); let cols = self.tracks.x.len().max(1); |
