//! Colorable geometrical shapes. use std::f64::consts::SQRT_2; use super::prelude::*; use super::TextNode; /// Place a node into a sizable and fillable shape. #[derive(Debug, Hash)] pub struct ShapeNode { /// Which shape to place the child into. pub kind: S, /// The child node to place into the shape, if any. pub child: Option, } #[class] impl ShapeNode { /// How to fill the shape. pub const FILL: Option = None; /// How the stroke the shape. pub const STROKE: Smart> = Smart::Auto; /// The stroke's thickness. pub const THICKNESS: Length = Length::pt(1.0); /// How much to pad the shape's content. pub const PADDING: Linear = Linear::zero(); fn construct(_: &mut EvalContext, args: &mut Args) -> TypResult