1 #ifndef _RIVE_STAR_BASE_HPP_
2 #define _RIVE_STAR_BASE_HPP_
3 #include "core/field_types/core_double_type.hpp"
4 #include "shapes/polygon.hpp"
7 class StarBase : public Polygon
10 typedef Polygon Super;
13 static const uint16_t typeKey = 52;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case StarBase::typeKey:
22 case PolygonBase::typeKey:
23 case ParametricPathBase::typeKey:
24 case PathBase::typeKey:
25 case NodeBase::typeKey:
26 case TransformComponentBase::typeKey:
27 case ContainerComponentBase::typeKey:
28 case ComponentBase::typeKey:
35 uint16_t coreType() const override { return typeKey; }
37 static const uint16_t innerRadiusPropertyKey = 127;
40 float m_InnerRadius = 0.5f;
42 inline float innerRadius() const { return m_InnerRadius; }
43 void innerRadius(float value)
45 if (m_InnerRadius == value)
49 m_InnerRadius = value;
53 Core* clone() const override;
54 void copy(const StarBase& object)
56 m_InnerRadius = object.m_InnerRadius;
57 Polygon::copy(object);
60 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
64 case innerRadiusPropertyKey:
65 m_InnerRadius = CoreDoubleType::deserialize(reader);
68 return Polygon::deserialize(propertyKey, reader);
72 virtual void innerRadiusChanged() {}