1 #ifndef _RIVE_PATH_VERTEX_BASE_HPP_
2 #define _RIVE_PATH_VERTEX_BASE_HPP_
3 #include "container_component.hpp"
4 #include "core/field_types/core_double_type.hpp"
7 class PathVertexBase : public ContainerComponent
10 typedef ContainerComponent Super;
13 static const uint16_t typeKey = 14;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case PathVertexBase::typeKey:
22 case ContainerComponentBase::typeKey:
23 case ComponentBase::typeKey:
30 uint16_t coreType() const override { return typeKey; }
32 static const uint16_t xPropertyKey = 24;
33 static const uint16_t yPropertyKey = 25;
39 inline float x() const { return m_X; }
50 inline float y() const { return m_Y; }
61 void copy(const PathVertexBase& object)
65 ContainerComponent::copy(object);
68 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
73 m_X = CoreDoubleType::deserialize(reader);
76 m_Y = CoreDoubleType::deserialize(reader);
79 return ContainerComponent::deserialize(propertyKey, reader);
83 virtual void xChanged() {}
84 virtual void yChanged() {}