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 serde::{Deserialize, Serialize};
5
6/// This represents a cubic bezier path.
7/// Note that for interpolation to work correctly all bezier values in a
8/// property's keyframe must have the same number of points.
9#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
10pub struct Bezier {
11 /// Whether the bezier forms a closed loop
12 #[serde(rename = "c")]
13 #[serde(skip_serializing_if = "Option::is_none")]
14 pub closed: Option<bool>,
15
16 /// Points along the curve
17 #[serde(rename = "v")]
18 pub vertices: Vec<[f64; 2]>,
19
20 /// Cubic control points, incoming tangent
21 #[serde(rename = "i")]
22 pub in_tangents: Vec<[f64; 2]>,
23
24 /// Cubic control points, outgoing tangent
25 #[serde(rename = "o")]
26 pub out_tangents: Vec<[f64; 2]>,
27}