tawasuyu/llimphi
Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.
1// Copyright 2024 the Velato Authors
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3
4use crate::schema::animated_properties::value::FloatValue;
5use crate::schema::constants::star_type::StarType;
6use crate::schema::{animated_properties::position::Position, shapes::shape::Shape};
7use serde::{Deserialize, Serialize};
8
9/// Regular polygon or star.
10#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
11pub struct PolyStarShape {
12 #[serde(flatten)]
13 pub shape: Shape,
14 /// Position
15 #[serde(rename = "p")]
16 pub position: Position,
17 /// Outer Radius
18 #[serde(rename = "or")]
19 pub outer_radius: FloatValue,
20 /// Outer Roundness as a percentage
21 #[serde(rename = "os")]
22 pub outer_roundness: FloatValue,
23 /// Rotation, clockwise in degrees
24 #[serde(rename = "r")]
25 pub rotation: FloatValue,
26 /// Points
27 #[serde(rename = "pt")]
28 pub points: FloatValue,
29 /// Star type, 1 for Star, 2 for Polygon
30 #[serde(rename = "sy")]
31 pub star_type: StarType,
32 /// If sy is 1 (star) you also have attributes defining the inner ends of
33 /// the star:
34 /// Points
35 #[serde(rename = "ir")]
36 pub inner_radius: Option<FloatValue>,
37 /// Star type, 1 for Star, 2 for Polygon
38 #[serde(rename = "is")]
39 pub inner_roundness: Option<FloatValue>,
40}