diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h b/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h new file mode 100644 index 00000000000000..f0a9b376f6f415 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h @@ -0,0 +1,24 @@ +#pragma once + +namespace facebook::react { + +enum class UnitType { + Undefined, + Point, + Percent, +}; + +struct ValueUnit { + float value{0.0f}; + UnitType unit{UnitType::Undefined}; + + ValueUnit(float v, UnitType u) : value(v), unit(u) {} + + bool operator==(const ValueUnit& other) const { + return value == other.value && unit == other.unit; + } + bool operator!=(const ValueUnit& other) const { + return !(*this == other); + } +}; +}