rive_rs/shapes/
straight_vertex.rs
1use crate::core::{Core, ObjectRef, OnAdded, Property};
6use crate::shapes::PathVertex;
7
8#[derive(Debug, Default)]
9pub struct StraightVertex {
10 path_vertex: PathVertex,
11 radius: Property<f32>,
12}
13
14impl ObjectRef<'_, StraightVertex> {
15 pub fn radius(&self) -> f32 {
16 self.radius.get()
17 }
18
19 pub fn set_radius(&self, radius: f32) {
20 if self.radius() == radius {
21 return;
22 }
23
24 self.radius.set(radius);
25 self.cast::<PathVertex>().mark_path_dirty();
26 }
27}
28
29impl Core for StraightVertex {
30 parent_types![(path_vertex, PathVertex)];
31
32 properties![(26, radius, set_radius), path_vertex];
33}
34
35impl OnAdded for ObjectRef<'_, StraightVertex> {
36 on_added!(PathVertex);
37}