Layout bitfield to props with keying - Move layout styles previously in bitfields to core properties - Add KeyFrameUint for keying int values (hold keyframes) - Add alignment property that can compute the layout properties related to alignment at runtime rather than storing them - Add ComboBox in the keyed object hierarchy which displays style related enum values https://github.com/rive-app/rive/assets/186340/ec2ecbde-e539-40cc-b964-2791ad28cc22 Diffs= e5db5a652 Layout bitfield to props with keying (#7478) Co-authored-by: Philip Chung <philterdesign@gmail.com>
diff --git a/.rive_head b/.rive_head index b050784..a74cdfb 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -1adf3dbf4acbba7560e6e25986de126a0ca11c49 +e5db5a652fedb8dd8c9708f02536e23ab12210d9
diff --git a/dev/defs/animation/keyframe_uint.json b/dev/defs/animation/keyframe_uint.json new file mode 100644 index 0000000..2a0fe0e --- /dev/null +++ b/dev/defs/animation/keyframe_uint.json
@@ -0,0 +1,19 @@ +{ + "name": "KeyFrameUint", + "key": { + "int": 450, + "string": "keyframeuint" + }, + "extends": "animation/interpolating_keyframe.json", + "properties": { + "value": { + "type": "uint", + "typeRuntime": "uint", + "initialValue": "0", + "key": { + "int": 631, + "string": "value" + } + } + } +} \ No newline at end of file
diff --git a/dev/defs/layout/layout_component_style.json b/dev/defs/layout/layout_component_style.json index 194601b..9bddf11 100644 --- a/dev/defs/layout/layout_component_style.json +++ b/dev/defs/layout/layout_component_style.json
@@ -6,33 +6,6 @@ }, "extends": "component.json", "properties": { - "layoutFlags0": { - "type": "uint", - "initialValue": "0x5000412", - "key": { - "int": 495, - "string": "layoutflags0" - }, - "description": "First BitFlags for layout styles." - }, - "layoutFlags1": { - "type": "uint", - "initialValue": "0x00", - "key": { - "int": 496, - "string": "layoutflags1" - }, - "description": "Second BitFlags for layout styles." - }, - "layoutFlags2": { - "type": "uint", - "initialValue": "0x00", - "key": { - "int": 497, - "string": "layoutflags2" - }, - "description": "Third BitFlags for layout styles." - }, "gapHorizontal": { "type": "double", "initialValue": "0", @@ -103,6 +76,7 @@ "type": "double", "initialValue": "0", "animates": true, + "group": "layoutborder", "key": { "int": 504, "string": "borderleft" @@ -113,6 +87,7 @@ "type": "double", "initialValue": "0", "animates": true, + "group": "layoutborder", "key": { "int": 505, "string": "borderright" @@ -123,6 +98,7 @@ "type": "double", "initialValue": "0", "animates": true, + "group": "layoutborder", "key": { "int": 506, "string": "bordertop" @@ -133,6 +109,7 @@ "type": "double", "initialValue": "0", "animates": true, + "group": "layoutborder", "key": { "int": 507, "string": "borderbottom" @@ -348,6 +325,15 @@ "string": "scaletype" } }, + "layoutAlignmentType": { + "type": "uint", + "initialValue": "0", + "animates": true, + "key": { + "int": 632, + "string": "layoutalignmenttype" + } + }, "animationStyleType": { "type": "uint", "initialValue": "0", @@ -385,6 +371,352 @@ "string": "interpolationtime" }, "description": "The time over which the interpolator applies." + }, + "displayValue": { + "type": "uint", + "initialValue": "0", + "key": { + "int": 596, + "string": "displayvalue" + }, + "description": "" + }, + "positionTypeValue": { + "type": "uint", + "initialValue": "1", + "key": { + "int": 597, + "string": "positiontypevalue" + }, + "description": "" + }, + "flexDirectionValue": { + "type": "uint", + "initialValue": "2", + "animates": true, + "key": { + "int": 598, + "string": "flexdirectionvalue" + }, + "description": "Flex dir" + }, + "directionValue": { + "type": "uint", + "initialValue": "0", + "animates": true, + "key": { + "int": 599, + "string": "directionvalue" + }, + "description": "" + }, + "alignContentValue": { + "type": "uint", + "initialValue": "0", + "animates": true, + "key": { + "int": 600, + "string": "aligncontentvalue" + }, + "description": "" + }, + "alignItemsValue": { + "type": "uint", + "initialValue": "1", + "animates": true, + "key": { + "int": 601, + "string": "alignitemsvalue" + }, + "description": "" + }, + "alignSelfValue": { + "type": "uint", + "initialValue": "0", + "animates": true, + "key": { + "int": 602, + "string": "alignselfvalue" + }, + "description": "" + }, + "justifyContentValue": { + "type": "uint", + "initialValue": "0", + "animates": true, + "key": { + "int": 603, + "string": "justifycontentvalue" + }, + "description": "" + }, + "flexWrapValue": { + "type": "uint", + "initialValue": "0", + "animates": true, + "key": { + "int": 604, + "string": "flexwrapvalue" + }, + "description": "" + }, + "overflowValue": { + "type": "uint", + "initialValue": "0", + "animates": true, + "key": { + "int": 605, + "string": "overflowvalue" + }, + "description": "" + }, + "intrinsicallySizedValue": { + "type": "bool", + "initialValue": "false", + "animates": true, + "key": { + "int": 606, + "string": "intrinsicallysizedvalue" + }, + "description": "" + }, + "widthUnitsValue": { + "type": "uint", + "initialValue": "1", + "key": { + "int": 607, + "string": "widthunitsvalue" + }, + "description": "" + }, + "heightUnitsValue": { + "type": "uint", + "initialValue": "1", + "key": { + "int": 608, + "string": "heightunitsvalue" + }, + "description": "" + }, + "borderLeftUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutborder", + "key": { + "int": 609, + "string": "borderleftunitsvalue" + }, + "description": "" + }, + "borderRightUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutborder", + "key": { + "int": 610, + "string": "borderrightunitsvalue" + }, + "description": "" + }, + "borderTopUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutborder", + "key": { + "int": 611, + "string": "bordertopunitsvalue" + }, + "description": "" + }, + "borderBottomUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutborder", + "key": { + "int": 612, + "string": "borderbottomunitsvalue" + }, + "description": "" + }, + "marginLeftUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmargin", + "key": { + "int": 613, + "string": "marginleftunitsvalue" + }, + "description": "" + }, + "marginRightUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmargin", + "key": { + "int": 614, + "string": "marginrightunitsvalue" + }, + "description": "" + }, + "marginTopUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmargin", + "key": { + "int": 615, + "string": "margintopunitsvalue" + }, + "description": "" + }, + "marginBottomUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmargin", + "key": { + "int": 616, + "string": "marginbottomunitsvalue" + }, + "description": "" + }, + "paddingLeftUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutpadding", + "key": { + "int": 617, + "string": "paddingleftunitsvalue" + }, + "description": "" + }, + "paddingRightUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutpadding", + "key": { + "int": 618, + "string": "paddingrightunitsvalue" + }, + "description": "" + }, + "paddingTopUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutpadding", + "key": { + "int": 619, + "string": "paddingtopunitsvalue" + }, + "description": "" + }, + "paddingBottomUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutpadding", + "key": { + "int": 620, + "string": "paddingbottomunitsvalue" + }, + "description": "" + }, + "positionLeftUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutposition", + "key": { + "int": 621, + "string": "positionleftunitsvalue" + }, + "description": "" + }, + "positionRightUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutposition", + "key": { + "int": 622, + "string": "positionrightunitsvalue" + }, + "description": "" + }, + "positionTopUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutposition", + "key": { + "int": 623, + "string": "positiontopunitsvalue" + }, + "description": "" + }, + "positionBottomUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutposition", + "key": { + "int": 624, + "string": "positionbottomunitsvalue" + }, + "description": "" + }, + "gapHorizontalUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutgap", + "key": { + "int": 625, + "string": "gaphorizontalunitsvalue" + }, + "description": "" + }, + "gapVerticalUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutgap", + "key": { + "int": 626, + "string": "gapverticalunitsvalue" + }, + "description": "" + }, + "minWidthUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmin", + "key": { + "int": 627, + "string": "minwidthunitsvalue" + }, + "description": "" + }, + "minHeightUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmin", + "key": { + "int": 628, + "string": "minheightunitsvalue" + }, + "description": "" + }, + "maxWidthUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmax", + "key": { + "int": 629, + "string": "maxwidthunitsvalue" + }, + "description": "" + }, + "maxHeightUnitsValue": { + "type": "uint", + "initialValue": "0", + "group": "layoutmax", + "key": { + "int": 630, + "string": "maxheightunitsvalue" + }, + "description": "" } } } \ No newline at end of file
diff --git a/include/rive/animation/keyframe_uint.hpp b/include/rive/animation/keyframe_uint.hpp new file mode 100644 index 0000000..2b398de --- /dev/null +++ b/include/rive/animation/keyframe_uint.hpp
@@ -0,0 +1,19 @@ +#ifndef _RIVE_KEY_FRAME_UINT_HPP_ +#define _RIVE_KEY_FRAME_UINT_HPP_ +#include "rive/generated/animation/keyframe_uint_base.hpp" +#include <stdio.h> +namespace rive +{ +class KeyFrameUint : public KeyFrameUintBase +{ +public: + void apply(Core* object, int propertyKey, float mix) override; + void applyInterpolation(Core* object, + int propertyKey, + float seconds, + const KeyFrame* nextFrame, + float mix) override; +}; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/artboard.hpp b/include/rive/artboard.hpp index ad869a9..1051af9 100644 --- a/include/rive/artboard.hpp +++ b/include/rive/artboard.hpp
@@ -124,6 +124,17 @@ m_dirtyLayout.insert(layoutComponent); } +#ifdef WITH_RIVE_LAYOUT + AABB layoutBounds() override + { + if (!hasLayoutMeasurements()) + { + return AABB(x(), y(), x() + width(), y() + height()); + } + return Super::layoutBounds(); + } +#endif + bool advance(double elapsedSeconds); bool advanceInternal(double elapsedSeconds, bool isRoot); bool hasChangedDrawOrderInLastUpdate() { return m_HasChangedDrawOrderInLastUpdate; };
diff --git a/include/rive/generated/animation/keyframe_uint_base.hpp b/include/rive/generated/animation/keyframe_uint_base.hpp new file mode 100644 index 0000000..cdf0bd1 --- /dev/null +++ b/include/rive/generated/animation/keyframe_uint_base.hpp
@@ -0,0 +1,72 @@ +#ifndef _RIVE_KEY_FRAME_UINT_BASE_HPP_ +#define _RIVE_KEY_FRAME_UINT_BASE_HPP_ +#include "rive/animation/interpolating_keyframe.hpp" +#include "rive/core/field_types/core_uint_type.hpp" +namespace rive +{ +class KeyFrameUintBase : public InterpolatingKeyFrame +{ +protected: + typedef InterpolatingKeyFrame Super; + +public: + static const uint16_t typeKey = 450; + + /// Helper to quickly determine if a core object extends another without RTTI + /// at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case KeyFrameUintBase::typeKey: + case InterpolatingKeyFrameBase::typeKey: + case KeyFrameBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + static const uint16_t valuePropertyKey = 631; + +private: + uint32_t m_Value = 0; + +public: + inline uint32_t value() const { return m_Value; } + void value(uint32_t value) + { + if (m_Value == value) + { + return; + } + m_Value = value; + valueChanged(); + } + + Core* clone() const override; + void copy(const KeyFrameUintBase& object) + { + m_Value = object.m_Value; + InterpolatingKeyFrame::copy(object); + } + + bool deserialize(uint16_t propertyKey, BinaryReader& reader) override + { + switch (propertyKey) + { + case valuePropertyKey: + m_Value = CoreUintType::deserialize(reader); + return true; + } + return InterpolatingKeyFrame::deserialize(propertyKey, reader); + } + +protected: + virtual void valueChanged() {} +}; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/core_registry.hpp b/include/rive/generated/core_registry.hpp index 66dc240..519c064 100644 --- a/include/rive/generated/core_registry.hpp +++ b/include/rive/generated/core_registry.hpp
@@ -29,6 +29,7 @@ #include "rive/animation/keyframe_id.hpp" #include "rive/animation/keyframe_interpolator.hpp" #include "rive/animation/keyframe_string.hpp" +#include "rive/animation/keyframe_uint.hpp" #include "rive/animation/layer_state.hpp" #include "rive/animation/linear_animation.hpp" #include "rive/animation/listener_action.hpp" @@ -255,6 +256,8 @@ return new LayoutComponentStyle(); case ListenerFireEventBase::typeKey: return new ListenerFireEvent(); + case KeyFrameUintBase::typeKey: + return new KeyFrameUint(); case NestedSimpleAnimationBase::typeKey: return new NestedSimpleAnimation(); case AnimationStateBase::typeKey: @@ -494,6 +497,9 @@ case FollowPathConstraintBase::offsetPropertyKey: object->as<FollowPathConstraintBase>()->offset(value); break; + case LayoutComponentStyleBase::intrinsicallySizedValuePropertyKey: + object->as<LayoutComponentStyleBase>()->intrinsicallySizedValue(value); + break; case NestedSimpleAnimationBase::isPlayingPropertyKey: object->as<NestedSimpleAnimationBase>()->isPlaying(value); break; @@ -623,18 +629,12 @@ case SoloBase::activeComponentIdPropertyKey: object->as<SoloBase>()->activeComponentId(value); break; - case LayoutComponentStyleBase::layoutFlags0PropertyKey: - object->as<LayoutComponentStyleBase>()->layoutFlags0(value); - break; - case LayoutComponentStyleBase::layoutFlags1PropertyKey: - object->as<LayoutComponentStyleBase>()->layoutFlags1(value); - break; - case LayoutComponentStyleBase::layoutFlags2PropertyKey: - object->as<LayoutComponentStyleBase>()->layoutFlags2(value); - break; case LayoutComponentStyleBase::scaleTypePropertyKey: object->as<LayoutComponentStyleBase>()->scaleType(value); break; + case LayoutComponentStyleBase::layoutAlignmentTypePropertyKey: + object->as<LayoutComponentStyleBase>()->layoutAlignmentType(value); + break; case LayoutComponentStyleBase::animationStyleTypePropertyKey: object->as<LayoutComponentStyleBase>()->animationStyleType(value); break; @@ -644,12 +644,126 @@ case LayoutComponentStyleBase::interpolatorIdPropertyKey: object->as<LayoutComponentStyleBase>()->interpolatorId(value); break; + case LayoutComponentStyleBase::displayValuePropertyKey: + object->as<LayoutComponentStyleBase>()->displayValue(value); + break; + case LayoutComponentStyleBase::positionTypeValuePropertyKey: + object->as<LayoutComponentStyleBase>()->positionTypeValue(value); + break; + case LayoutComponentStyleBase::flexDirectionValuePropertyKey: + object->as<LayoutComponentStyleBase>()->flexDirectionValue(value); + break; + case LayoutComponentStyleBase::directionValuePropertyKey: + object->as<LayoutComponentStyleBase>()->directionValue(value); + break; + case LayoutComponentStyleBase::alignContentValuePropertyKey: + object->as<LayoutComponentStyleBase>()->alignContentValue(value); + break; + case LayoutComponentStyleBase::alignItemsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->alignItemsValue(value); + break; + case LayoutComponentStyleBase::alignSelfValuePropertyKey: + object->as<LayoutComponentStyleBase>()->alignSelfValue(value); + break; + case LayoutComponentStyleBase::justifyContentValuePropertyKey: + object->as<LayoutComponentStyleBase>()->justifyContentValue(value); + break; + case LayoutComponentStyleBase::flexWrapValuePropertyKey: + object->as<LayoutComponentStyleBase>()->flexWrapValue(value); + break; + case LayoutComponentStyleBase::overflowValuePropertyKey: + object->as<LayoutComponentStyleBase>()->overflowValue(value); + break; + case LayoutComponentStyleBase::widthUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->widthUnitsValue(value); + break; + case LayoutComponentStyleBase::heightUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->heightUnitsValue(value); + break; + case LayoutComponentStyleBase::borderLeftUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->borderLeftUnitsValue(value); + break; + case LayoutComponentStyleBase::borderRightUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->borderRightUnitsValue(value); + break; + case LayoutComponentStyleBase::borderTopUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->borderTopUnitsValue(value); + break; + case LayoutComponentStyleBase::borderBottomUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->borderBottomUnitsValue(value); + break; + case LayoutComponentStyleBase::marginLeftUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->marginLeftUnitsValue(value); + break; + case LayoutComponentStyleBase::marginRightUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->marginRightUnitsValue(value); + break; + case LayoutComponentStyleBase::marginTopUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->marginTopUnitsValue(value); + break; + case LayoutComponentStyleBase::marginBottomUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->marginBottomUnitsValue(value); + break; + case LayoutComponentStyleBase::paddingLeftUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->paddingLeftUnitsValue(value); + break; + case LayoutComponentStyleBase::paddingRightUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->paddingRightUnitsValue(value); + break; + case LayoutComponentStyleBase::paddingTopUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->paddingTopUnitsValue(value); + break; + case LayoutComponentStyleBase::paddingBottomUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->paddingBottomUnitsValue(value); + break; + case LayoutComponentStyleBase::positionLeftUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->positionLeftUnitsValue(value); + break; + case LayoutComponentStyleBase::positionRightUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->positionRightUnitsValue(value); + break; + case LayoutComponentStyleBase::positionTopUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->positionTopUnitsValue(value); + break; + case LayoutComponentStyleBase::positionBottomUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->positionBottomUnitsValue(value); + break; + case LayoutComponentStyleBase::gapHorizontalUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->gapHorizontalUnitsValue(value); + break; + case LayoutComponentStyleBase::gapVerticalUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->gapVerticalUnitsValue(value); + break; + case LayoutComponentStyleBase::minWidthUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->minWidthUnitsValue(value); + break; + case LayoutComponentStyleBase::minHeightUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->minHeightUnitsValue(value); + break; + case LayoutComponentStyleBase::maxWidthUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->maxWidthUnitsValue(value); + break; + case LayoutComponentStyleBase::maxHeightUnitsValuePropertyKey: + object->as<LayoutComponentStyleBase>()->maxHeightUnitsValue(value); + break; case ListenerFireEventBase::eventIdPropertyKey: object->as<ListenerFireEventBase>()->eventId(value); break; case LayerStateBase::flagsPropertyKey: object->as<LayerStateBase>()->flags(value); break; + case KeyFrameBase::framePropertyKey: + object->as<KeyFrameBase>()->frame(value); + break; + case InterpolatingKeyFrameBase::interpolationTypePropertyKey: + object->as<InterpolatingKeyFrameBase>()->interpolationType(value); + break; + case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: + object->as<InterpolatingKeyFrameBase>()->interpolatorId(value); + break; + case KeyFrameUintBase::valuePropertyKey: + object->as<KeyFrameUintBase>()->value(value); + break; case ListenerInputChangeBase::inputIdPropertyKey: object->as<ListenerInputChangeBase>()->inputId(value); break; @@ -689,15 +803,6 @@ case StateMachineListenerBase::eventIdPropertyKey: object->as<StateMachineListenerBase>()->eventId(value); break; - case KeyFrameBase::framePropertyKey: - object->as<KeyFrameBase>()->frame(value); - break; - case InterpolatingKeyFrameBase::interpolationTypePropertyKey: - object->as<InterpolatingKeyFrameBase>()->interpolationType(value); - break; - case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: - object->as<InterpolatingKeyFrameBase>()->interpolatorId(value); - break; case KeyFrameIdBase::valuePropertyKey: object->as<KeyFrameIdBase>()->value(value); break; @@ -1490,6 +1595,8 @@ return object->as<FollowPathConstraintBase>()->orient(); case FollowPathConstraintBase::offsetPropertyKey: return object->as<FollowPathConstraintBase>()->offset(); + case LayoutComponentStyleBase::intrinsicallySizedValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->intrinsicallySizedValue(); case NestedSimpleAnimationBase::isPlayingPropertyKey: return object->as<NestedSimpleAnimationBase>()->isPlaying(); case KeyFrameBoolBase::valuePropertyKey: @@ -1579,24 +1686,96 @@ return object->as<NestedAnimationBase>()->animationId(); case SoloBase::activeComponentIdPropertyKey: return object->as<SoloBase>()->activeComponentId(); - case LayoutComponentStyleBase::layoutFlags0PropertyKey: - return object->as<LayoutComponentStyleBase>()->layoutFlags0(); - case LayoutComponentStyleBase::layoutFlags1PropertyKey: - return object->as<LayoutComponentStyleBase>()->layoutFlags1(); - case LayoutComponentStyleBase::layoutFlags2PropertyKey: - return object->as<LayoutComponentStyleBase>()->layoutFlags2(); case LayoutComponentStyleBase::scaleTypePropertyKey: return object->as<LayoutComponentStyleBase>()->scaleType(); + case LayoutComponentStyleBase::layoutAlignmentTypePropertyKey: + return object->as<LayoutComponentStyleBase>()->layoutAlignmentType(); case LayoutComponentStyleBase::animationStyleTypePropertyKey: return object->as<LayoutComponentStyleBase>()->animationStyleType(); case LayoutComponentStyleBase::interpolationTypePropertyKey: return object->as<LayoutComponentStyleBase>()->interpolationType(); case LayoutComponentStyleBase::interpolatorIdPropertyKey: return object->as<LayoutComponentStyleBase>()->interpolatorId(); + case LayoutComponentStyleBase::displayValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->displayValue(); + case LayoutComponentStyleBase::positionTypeValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->positionTypeValue(); + case LayoutComponentStyleBase::flexDirectionValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->flexDirectionValue(); + case LayoutComponentStyleBase::directionValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->directionValue(); + case LayoutComponentStyleBase::alignContentValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->alignContentValue(); + case LayoutComponentStyleBase::alignItemsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->alignItemsValue(); + case LayoutComponentStyleBase::alignSelfValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->alignSelfValue(); + case LayoutComponentStyleBase::justifyContentValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->justifyContentValue(); + case LayoutComponentStyleBase::flexWrapValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->flexWrapValue(); + case LayoutComponentStyleBase::overflowValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->overflowValue(); + case LayoutComponentStyleBase::widthUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->widthUnitsValue(); + case LayoutComponentStyleBase::heightUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->heightUnitsValue(); + case LayoutComponentStyleBase::borderLeftUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->borderLeftUnitsValue(); + case LayoutComponentStyleBase::borderRightUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->borderRightUnitsValue(); + case LayoutComponentStyleBase::borderTopUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->borderTopUnitsValue(); + case LayoutComponentStyleBase::borderBottomUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->borderBottomUnitsValue(); + case LayoutComponentStyleBase::marginLeftUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->marginLeftUnitsValue(); + case LayoutComponentStyleBase::marginRightUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->marginRightUnitsValue(); + case LayoutComponentStyleBase::marginTopUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->marginTopUnitsValue(); + case LayoutComponentStyleBase::marginBottomUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->marginBottomUnitsValue(); + case LayoutComponentStyleBase::paddingLeftUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->paddingLeftUnitsValue(); + case LayoutComponentStyleBase::paddingRightUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->paddingRightUnitsValue(); + case LayoutComponentStyleBase::paddingTopUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->paddingTopUnitsValue(); + case LayoutComponentStyleBase::paddingBottomUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->paddingBottomUnitsValue(); + case LayoutComponentStyleBase::positionLeftUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->positionLeftUnitsValue(); + case LayoutComponentStyleBase::positionRightUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->positionRightUnitsValue(); + case LayoutComponentStyleBase::positionTopUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->positionTopUnitsValue(); + case LayoutComponentStyleBase::positionBottomUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->positionBottomUnitsValue(); + case LayoutComponentStyleBase::gapHorizontalUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->gapHorizontalUnitsValue(); + case LayoutComponentStyleBase::gapVerticalUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->gapVerticalUnitsValue(); + case LayoutComponentStyleBase::minWidthUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->minWidthUnitsValue(); + case LayoutComponentStyleBase::minHeightUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->minHeightUnitsValue(); + case LayoutComponentStyleBase::maxWidthUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->maxWidthUnitsValue(); + case LayoutComponentStyleBase::maxHeightUnitsValuePropertyKey: + return object->as<LayoutComponentStyleBase>()->maxHeightUnitsValue(); case ListenerFireEventBase::eventIdPropertyKey: return object->as<ListenerFireEventBase>()->eventId(); case LayerStateBase::flagsPropertyKey: return object->as<LayerStateBase>()->flags(); + case KeyFrameBase::framePropertyKey: + return object->as<KeyFrameBase>()->frame(); + case InterpolatingKeyFrameBase::interpolationTypePropertyKey: + return object->as<InterpolatingKeyFrameBase>()->interpolationType(); + case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: + return object->as<InterpolatingKeyFrameBase>()->interpolatorId(); + case KeyFrameUintBase::valuePropertyKey: + return object->as<KeyFrameUintBase>()->value(); case ListenerInputChangeBase::inputIdPropertyKey: return object->as<ListenerInputChangeBase>()->inputId(); case ListenerInputChangeBase::nestedInputIdPropertyKey: @@ -1623,12 +1802,6 @@ return object->as<StateMachineListenerBase>()->listenerTypeValue(); case StateMachineListenerBase::eventIdPropertyKey: return object->as<StateMachineListenerBase>()->eventId(); - case KeyFrameBase::framePropertyKey: - return object->as<KeyFrameBase>()->frame(); - case InterpolatingKeyFrameBase::interpolationTypePropertyKey: - return object->as<InterpolatingKeyFrameBase>()->interpolationType(); - case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: - return object->as<InterpolatingKeyFrameBase>()->interpolatorId(); case KeyFrameIdBase::valuePropertyKey: return object->as<KeyFrameIdBase>()->value(); case ListenerBoolChangeBase::valuePropertyKey: @@ -2157,6 +2330,7 @@ case IKConstraintBase::invertDirectionPropertyKey: case FollowPathConstraintBase::orientPropertyKey: case FollowPathConstraintBase::offsetPropertyKey: + case LayoutComponentStyleBase::intrinsicallySizedValuePropertyKey: case NestedSimpleAnimationBase::isPlayingPropertyKey: case KeyFrameBoolBase::valuePropertyKey: case ListenerAlignTargetBase::preserveOffsetPropertyKey: @@ -2199,15 +2373,51 @@ case NestedArtboardBase::alignmentPropertyKey: case NestedAnimationBase::animationIdPropertyKey: case SoloBase::activeComponentIdPropertyKey: - case LayoutComponentStyleBase::layoutFlags0PropertyKey: - case LayoutComponentStyleBase::layoutFlags1PropertyKey: - case LayoutComponentStyleBase::layoutFlags2PropertyKey: case LayoutComponentStyleBase::scaleTypePropertyKey: + case LayoutComponentStyleBase::layoutAlignmentTypePropertyKey: case LayoutComponentStyleBase::animationStyleTypePropertyKey: case LayoutComponentStyleBase::interpolationTypePropertyKey: case LayoutComponentStyleBase::interpolatorIdPropertyKey: + case LayoutComponentStyleBase::displayValuePropertyKey: + case LayoutComponentStyleBase::positionTypeValuePropertyKey: + case LayoutComponentStyleBase::flexDirectionValuePropertyKey: + case LayoutComponentStyleBase::directionValuePropertyKey: + case LayoutComponentStyleBase::alignContentValuePropertyKey: + case LayoutComponentStyleBase::alignItemsValuePropertyKey: + case LayoutComponentStyleBase::alignSelfValuePropertyKey: + case LayoutComponentStyleBase::justifyContentValuePropertyKey: + case LayoutComponentStyleBase::flexWrapValuePropertyKey: + case LayoutComponentStyleBase::overflowValuePropertyKey: + case LayoutComponentStyleBase::widthUnitsValuePropertyKey: + case LayoutComponentStyleBase::heightUnitsValuePropertyKey: + case LayoutComponentStyleBase::borderLeftUnitsValuePropertyKey: + case LayoutComponentStyleBase::borderRightUnitsValuePropertyKey: + case LayoutComponentStyleBase::borderTopUnitsValuePropertyKey: + case LayoutComponentStyleBase::borderBottomUnitsValuePropertyKey: + case LayoutComponentStyleBase::marginLeftUnitsValuePropertyKey: + case LayoutComponentStyleBase::marginRightUnitsValuePropertyKey: + case LayoutComponentStyleBase::marginTopUnitsValuePropertyKey: + case LayoutComponentStyleBase::marginBottomUnitsValuePropertyKey: + case LayoutComponentStyleBase::paddingLeftUnitsValuePropertyKey: + case LayoutComponentStyleBase::paddingRightUnitsValuePropertyKey: + case LayoutComponentStyleBase::paddingTopUnitsValuePropertyKey: + case LayoutComponentStyleBase::paddingBottomUnitsValuePropertyKey: + case LayoutComponentStyleBase::positionLeftUnitsValuePropertyKey: + case LayoutComponentStyleBase::positionRightUnitsValuePropertyKey: + case LayoutComponentStyleBase::positionTopUnitsValuePropertyKey: + case LayoutComponentStyleBase::positionBottomUnitsValuePropertyKey: + case LayoutComponentStyleBase::gapHorizontalUnitsValuePropertyKey: + case LayoutComponentStyleBase::gapVerticalUnitsValuePropertyKey: + case LayoutComponentStyleBase::minWidthUnitsValuePropertyKey: + case LayoutComponentStyleBase::minHeightUnitsValuePropertyKey: + case LayoutComponentStyleBase::maxWidthUnitsValuePropertyKey: + case LayoutComponentStyleBase::maxHeightUnitsValuePropertyKey: case ListenerFireEventBase::eventIdPropertyKey: case LayerStateBase::flagsPropertyKey: + case KeyFrameBase::framePropertyKey: + case InterpolatingKeyFrameBase::interpolationTypePropertyKey: + case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: + case KeyFrameUintBase::valuePropertyKey: case ListenerInputChangeBase::inputIdPropertyKey: case ListenerInputChangeBase::nestedInputIdPropertyKey: case AnimationStateBase::animationIdPropertyKey: @@ -2221,9 +2431,6 @@ case StateMachineListenerBase::targetIdPropertyKey: case StateMachineListenerBase::listenerTypeValuePropertyKey: case StateMachineListenerBase::eventIdPropertyKey: - case KeyFrameBase::framePropertyKey: - case InterpolatingKeyFrameBase::interpolationTypePropertyKey: - case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: case KeyFrameIdBase::valuePropertyKey: case ListenerBoolChangeBase::valuePropertyKey: case ListenerAlignTargetBase::targetIdPropertyKey: @@ -2521,6 +2728,8 @@ return object->is<FollowPathConstraintBase>(); case FollowPathConstraintBase::offsetPropertyKey: return object->is<FollowPathConstraintBase>(); + case LayoutComponentStyleBase::intrinsicallySizedValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); case NestedSimpleAnimationBase::isPlayingPropertyKey: return object->is<NestedSimpleAnimationBase>(); case KeyFrameBoolBase::valuePropertyKey: @@ -2603,24 +2812,96 @@ return object->is<NestedAnimationBase>(); case SoloBase::activeComponentIdPropertyKey: return object->is<SoloBase>(); - case LayoutComponentStyleBase::layoutFlags0PropertyKey: - return object->is<LayoutComponentStyleBase>(); - case LayoutComponentStyleBase::layoutFlags1PropertyKey: - return object->is<LayoutComponentStyleBase>(); - case LayoutComponentStyleBase::layoutFlags2PropertyKey: - return object->is<LayoutComponentStyleBase>(); case LayoutComponentStyleBase::scaleTypePropertyKey: return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::layoutAlignmentTypePropertyKey: + return object->is<LayoutComponentStyleBase>(); case LayoutComponentStyleBase::animationStyleTypePropertyKey: return object->is<LayoutComponentStyleBase>(); case LayoutComponentStyleBase::interpolationTypePropertyKey: return object->is<LayoutComponentStyleBase>(); case LayoutComponentStyleBase::interpolatorIdPropertyKey: return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::displayValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::positionTypeValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::flexDirectionValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::directionValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::alignContentValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::alignItemsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::alignSelfValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::justifyContentValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::flexWrapValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::overflowValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::widthUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::heightUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::borderLeftUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::borderRightUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::borderTopUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::borderBottomUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::marginLeftUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::marginRightUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::marginTopUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::marginBottomUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::paddingLeftUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::paddingRightUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::paddingTopUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::paddingBottomUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::positionLeftUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::positionRightUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::positionTopUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::positionBottomUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::gapHorizontalUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::gapVerticalUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::minWidthUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::minHeightUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::maxWidthUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); + case LayoutComponentStyleBase::maxHeightUnitsValuePropertyKey: + return object->is<LayoutComponentStyleBase>(); case ListenerFireEventBase::eventIdPropertyKey: return object->is<ListenerFireEventBase>(); case LayerStateBase::flagsPropertyKey: return object->is<LayerStateBase>(); + case KeyFrameBase::framePropertyKey: + return object->is<KeyFrameBase>(); + case InterpolatingKeyFrameBase::interpolationTypePropertyKey: + return object->is<InterpolatingKeyFrameBase>(); + case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: + return object->is<InterpolatingKeyFrameBase>(); + case KeyFrameUintBase::valuePropertyKey: + return object->is<KeyFrameUintBase>(); case ListenerInputChangeBase::inputIdPropertyKey: return object->is<ListenerInputChangeBase>(); case ListenerInputChangeBase::nestedInputIdPropertyKey: @@ -2647,12 +2928,6 @@ return object->is<StateMachineListenerBase>(); case StateMachineListenerBase::eventIdPropertyKey: return object->is<StateMachineListenerBase>(); - case KeyFrameBase::framePropertyKey: - return object->is<KeyFrameBase>(); - case InterpolatingKeyFrameBase::interpolationTypePropertyKey: - return object->is<InterpolatingKeyFrameBase>(); - case InterpolatingKeyFrameBase::interpolatorIdPropertyKey: - return object->is<InterpolatingKeyFrameBase>(); case KeyFrameIdBase::valuePropertyKey: return object->is<KeyFrameIdBase>(); case ListenerBoolChangeBase::valuePropertyKey:
diff --git a/include/rive/generated/layout/layout_component_style_base.hpp b/include/rive/generated/layout/layout_component_style_base.hpp index 60163da..b62fa97 100644 --- a/include/rive/generated/layout/layout_component_style_base.hpp +++ b/include/rive/generated/layout/layout_component_style_base.hpp
@@ -1,6 +1,7 @@ #ifndef _RIVE_LAYOUT_COMPONENT_STYLE_BASE_HPP_ #define _RIVE_LAYOUT_COMPONENT_STYLE_BASE_HPP_ #include "rive/component.hpp" +#include "rive/core/field_types/core_bool_type.hpp" #include "rive/core/field_types/core_double_type.hpp" #include "rive/core/field_types/core_uint_type.hpp" namespace rive @@ -29,9 +30,6 @@ uint16_t coreType() const override { return typeKey; } - static const uint16_t layoutFlags0PropertyKey = 495; - static const uint16_t layoutFlags1PropertyKey = 496; - static const uint16_t layoutFlags2PropertyKey = 497; static const uint16_t gapHorizontalPropertyKey = 498; static const uint16_t gapVerticalPropertyKey = 499; static const uint16_t maxWidthPropertyKey = 500; @@ -60,15 +58,48 @@ static const uint16_t flexBasisPropertyKey = 523; static const uint16_t aspectRatioPropertyKey = 524; static const uint16_t scaleTypePropertyKey = 546; + static const uint16_t layoutAlignmentTypePropertyKey = 632; static const uint16_t animationStyleTypePropertyKey = 589; static const uint16_t interpolationTypePropertyKey = 590; static const uint16_t interpolatorIdPropertyKey = 591; static const uint16_t interpolationTimePropertyKey = 592; + static const uint16_t displayValuePropertyKey = 596; + static const uint16_t positionTypeValuePropertyKey = 597; + static const uint16_t flexDirectionValuePropertyKey = 598; + static const uint16_t directionValuePropertyKey = 599; + static const uint16_t alignContentValuePropertyKey = 600; + static const uint16_t alignItemsValuePropertyKey = 601; + static const uint16_t alignSelfValuePropertyKey = 602; + static const uint16_t justifyContentValuePropertyKey = 603; + static const uint16_t flexWrapValuePropertyKey = 604; + static const uint16_t overflowValuePropertyKey = 605; + static const uint16_t intrinsicallySizedValuePropertyKey = 606; + static const uint16_t widthUnitsValuePropertyKey = 607; + static const uint16_t heightUnitsValuePropertyKey = 608; + static const uint16_t borderLeftUnitsValuePropertyKey = 609; + static const uint16_t borderRightUnitsValuePropertyKey = 610; + static const uint16_t borderTopUnitsValuePropertyKey = 611; + static const uint16_t borderBottomUnitsValuePropertyKey = 612; + static const uint16_t marginLeftUnitsValuePropertyKey = 613; + static const uint16_t marginRightUnitsValuePropertyKey = 614; + static const uint16_t marginTopUnitsValuePropertyKey = 615; + static const uint16_t marginBottomUnitsValuePropertyKey = 616; + static const uint16_t paddingLeftUnitsValuePropertyKey = 617; + static const uint16_t paddingRightUnitsValuePropertyKey = 618; + static const uint16_t paddingTopUnitsValuePropertyKey = 619; + static const uint16_t paddingBottomUnitsValuePropertyKey = 620; + static const uint16_t positionLeftUnitsValuePropertyKey = 621; + static const uint16_t positionRightUnitsValuePropertyKey = 622; + static const uint16_t positionTopUnitsValuePropertyKey = 623; + static const uint16_t positionBottomUnitsValuePropertyKey = 624; + static const uint16_t gapHorizontalUnitsValuePropertyKey = 625; + static const uint16_t gapVerticalUnitsValuePropertyKey = 626; + static const uint16_t minWidthUnitsValuePropertyKey = 627; + static const uint16_t minHeightUnitsValuePropertyKey = 628; + static const uint16_t maxWidthUnitsValuePropertyKey = 629; + static const uint16_t maxHeightUnitsValuePropertyKey = 630; private: - uint32_t m_LayoutFlags0 = 0x5000412; - uint32_t m_LayoutFlags1 = 0x00; - uint32_t m_LayoutFlags2 = 0x00; float m_GapHorizontal = 0.0f; float m_GapVertical = 0.0f; float m_MaxWidth = 0.0f; @@ -97,45 +128,48 @@ float m_FlexBasis = 1.0f; float m_AspectRatio = 0.0f; uint32_t m_ScaleType = 0; + uint32_t m_LayoutAlignmentType = 0; uint32_t m_AnimationStyleType = 0; uint32_t m_InterpolationType = 0; uint32_t m_InterpolatorId = -1; float m_InterpolationTime = 0.0f; + uint32_t m_DisplayValue = 0; + uint32_t m_PositionTypeValue = 1; + uint32_t m_FlexDirectionValue = 2; + uint32_t m_DirectionValue = 0; + uint32_t m_AlignContentValue = 0; + uint32_t m_AlignItemsValue = 1; + uint32_t m_AlignSelfValue = 0; + uint32_t m_JustifyContentValue = 0; + uint32_t m_FlexWrapValue = 0; + uint32_t m_OverflowValue = 0; + bool m_IntrinsicallySizedValue = false; + uint32_t m_WidthUnitsValue = 1; + uint32_t m_HeightUnitsValue = 1; + uint32_t m_BorderLeftUnitsValue = 0; + uint32_t m_BorderRightUnitsValue = 0; + uint32_t m_BorderTopUnitsValue = 0; + uint32_t m_BorderBottomUnitsValue = 0; + uint32_t m_MarginLeftUnitsValue = 0; + uint32_t m_MarginRightUnitsValue = 0; + uint32_t m_MarginTopUnitsValue = 0; + uint32_t m_MarginBottomUnitsValue = 0; + uint32_t m_PaddingLeftUnitsValue = 0; + uint32_t m_PaddingRightUnitsValue = 0; + uint32_t m_PaddingTopUnitsValue = 0; + uint32_t m_PaddingBottomUnitsValue = 0; + uint32_t m_PositionLeftUnitsValue = 0; + uint32_t m_PositionRightUnitsValue = 0; + uint32_t m_PositionTopUnitsValue = 0; + uint32_t m_PositionBottomUnitsValue = 0; + uint32_t m_GapHorizontalUnitsValue = 0; + uint32_t m_GapVerticalUnitsValue = 0; + uint32_t m_MinWidthUnitsValue = 0; + uint32_t m_MinHeightUnitsValue = 0; + uint32_t m_MaxWidthUnitsValue = 0; + uint32_t m_MaxHeightUnitsValue = 0; public: - inline uint32_t layoutFlags0() const { return m_LayoutFlags0; } - void layoutFlags0(uint32_t value) - { - if (m_LayoutFlags0 == value) - { - return; - } - m_LayoutFlags0 = value; - layoutFlags0Changed(); - } - - inline uint32_t layoutFlags1() const { return m_LayoutFlags1; } - void layoutFlags1(uint32_t value) - { - if (m_LayoutFlags1 == value) - { - return; - } - m_LayoutFlags1 = value; - layoutFlags1Changed(); - } - - inline uint32_t layoutFlags2() const { return m_LayoutFlags2; } - void layoutFlags2(uint32_t value) - { - if (m_LayoutFlags2 == value) - { - return; - } - m_LayoutFlags2 = value; - layoutFlags2Changed(); - } - inline float gapHorizontal() const { return m_GapHorizontal; } void gapHorizontal(float value) { @@ -444,6 +478,17 @@ scaleTypeChanged(); } + inline uint32_t layoutAlignmentType() const { return m_LayoutAlignmentType; } + void layoutAlignmentType(uint32_t value) + { + if (m_LayoutAlignmentType == value) + { + return; + } + m_LayoutAlignmentType = value; + layoutAlignmentTypeChanged(); + } + inline uint32_t animationStyleType() const { return m_AnimationStyleType; } void animationStyleType(uint32_t value) { @@ -488,12 +533,394 @@ interpolationTimeChanged(); } + inline uint32_t displayValue() const { return m_DisplayValue; } + void displayValue(uint32_t value) + { + if (m_DisplayValue == value) + { + return; + } + m_DisplayValue = value; + displayValueChanged(); + } + + inline uint32_t positionTypeValue() const { return m_PositionTypeValue; } + void positionTypeValue(uint32_t value) + { + if (m_PositionTypeValue == value) + { + return; + } + m_PositionTypeValue = value; + positionTypeValueChanged(); + } + + inline uint32_t flexDirectionValue() const { return m_FlexDirectionValue; } + void flexDirectionValue(uint32_t value) + { + if (m_FlexDirectionValue == value) + { + return; + } + m_FlexDirectionValue = value; + flexDirectionValueChanged(); + } + + inline uint32_t directionValue() const { return m_DirectionValue; } + void directionValue(uint32_t value) + { + if (m_DirectionValue == value) + { + return; + } + m_DirectionValue = value; + directionValueChanged(); + } + + inline uint32_t alignContentValue() const { return m_AlignContentValue; } + void alignContentValue(uint32_t value) + { + if (m_AlignContentValue == value) + { + return; + } + m_AlignContentValue = value; + alignContentValueChanged(); + } + + inline uint32_t alignItemsValue() const { return m_AlignItemsValue; } + void alignItemsValue(uint32_t value) + { + if (m_AlignItemsValue == value) + { + return; + } + m_AlignItemsValue = value; + alignItemsValueChanged(); + } + + inline uint32_t alignSelfValue() const { return m_AlignSelfValue; } + void alignSelfValue(uint32_t value) + { + if (m_AlignSelfValue == value) + { + return; + } + m_AlignSelfValue = value; + alignSelfValueChanged(); + } + + inline uint32_t justifyContentValue() const { return m_JustifyContentValue; } + void justifyContentValue(uint32_t value) + { + if (m_JustifyContentValue == value) + { + return; + } + m_JustifyContentValue = value; + justifyContentValueChanged(); + } + + inline uint32_t flexWrapValue() const { return m_FlexWrapValue; } + void flexWrapValue(uint32_t value) + { + if (m_FlexWrapValue == value) + { + return; + } + m_FlexWrapValue = value; + flexWrapValueChanged(); + } + + inline uint32_t overflowValue() const { return m_OverflowValue; } + void overflowValue(uint32_t value) + { + if (m_OverflowValue == value) + { + return; + } + m_OverflowValue = value; + overflowValueChanged(); + } + + inline bool intrinsicallySizedValue() const { return m_IntrinsicallySizedValue; } + void intrinsicallySizedValue(bool value) + { + if (m_IntrinsicallySizedValue == value) + { + return; + } + m_IntrinsicallySizedValue = value; + intrinsicallySizedValueChanged(); + } + + inline uint32_t widthUnitsValue() const { return m_WidthUnitsValue; } + void widthUnitsValue(uint32_t value) + { + if (m_WidthUnitsValue == value) + { + return; + } + m_WidthUnitsValue = value; + widthUnitsValueChanged(); + } + + inline uint32_t heightUnitsValue() const { return m_HeightUnitsValue; } + void heightUnitsValue(uint32_t value) + { + if (m_HeightUnitsValue == value) + { + return; + } + m_HeightUnitsValue = value; + heightUnitsValueChanged(); + } + + inline uint32_t borderLeftUnitsValue() const { return m_BorderLeftUnitsValue; } + void borderLeftUnitsValue(uint32_t value) + { + if (m_BorderLeftUnitsValue == value) + { + return; + } + m_BorderLeftUnitsValue = value; + borderLeftUnitsValueChanged(); + } + + inline uint32_t borderRightUnitsValue() const { return m_BorderRightUnitsValue; } + void borderRightUnitsValue(uint32_t value) + { + if (m_BorderRightUnitsValue == value) + { + return; + } + m_BorderRightUnitsValue = value; + borderRightUnitsValueChanged(); + } + + inline uint32_t borderTopUnitsValue() const { return m_BorderTopUnitsValue; } + void borderTopUnitsValue(uint32_t value) + { + if (m_BorderTopUnitsValue == value) + { + return; + } + m_BorderTopUnitsValue = value; + borderTopUnitsValueChanged(); + } + + inline uint32_t borderBottomUnitsValue() const { return m_BorderBottomUnitsValue; } + void borderBottomUnitsValue(uint32_t value) + { + if (m_BorderBottomUnitsValue == value) + { + return; + } + m_BorderBottomUnitsValue = value; + borderBottomUnitsValueChanged(); + } + + inline uint32_t marginLeftUnitsValue() const { return m_MarginLeftUnitsValue; } + void marginLeftUnitsValue(uint32_t value) + { + if (m_MarginLeftUnitsValue == value) + { + return; + } + m_MarginLeftUnitsValue = value; + marginLeftUnitsValueChanged(); + } + + inline uint32_t marginRightUnitsValue() const { return m_MarginRightUnitsValue; } + void marginRightUnitsValue(uint32_t value) + { + if (m_MarginRightUnitsValue == value) + { + return; + } + m_MarginRightUnitsValue = value; + marginRightUnitsValueChanged(); + } + + inline uint32_t marginTopUnitsValue() const { return m_MarginTopUnitsValue; } + void marginTopUnitsValue(uint32_t value) + { + if (m_MarginTopUnitsValue == value) + { + return; + } + m_MarginTopUnitsValue = value; + marginTopUnitsValueChanged(); + } + + inline uint32_t marginBottomUnitsValue() const { return m_MarginBottomUnitsValue; } + void marginBottomUnitsValue(uint32_t value) + { + if (m_MarginBottomUnitsValue == value) + { + return; + } + m_MarginBottomUnitsValue = value; + marginBottomUnitsValueChanged(); + } + + inline uint32_t paddingLeftUnitsValue() const { return m_PaddingLeftUnitsValue; } + void paddingLeftUnitsValue(uint32_t value) + { + if (m_PaddingLeftUnitsValue == value) + { + return; + } + m_PaddingLeftUnitsValue = value; + paddingLeftUnitsValueChanged(); + } + + inline uint32_t paddingRightUnitsValue() const { return m_PaddingRightUnitsValue; } + void paddingRightUnitsValue(uint32_t value) + { + if (m_PaddingRightUnitsValue == value) + { + return; + } + m_PaddingRightUnitsValue = value; + paddingRightUnitsValueChanged(); + } + + inline uint32_t paddingTopUnitsValue() const { return m_PaddingTopUnitsValue; } + void paddingTopUnitsValue(uint32_t value) + { + if (m_PaddingTopUnitsValue == value) + { + return; + } + m_PaddingTopUnitsValue = value; + paddingTopUnitsValueChanged(); + } + + inline uint32_t paddingBottomUnitsValue() const { return m_PaddingBottomUnitsValue; } + void paddingBottomUnitsValue(uint32_t value) + { + if (m_PaddingBottomUnitsValue == value) + { + return; + } + m_PaddingBottomUnitsValue = value; + paddingBottomUnitsValueChanged(); + } + + inline uint32_t positionLeftUnitsValue() const { return m_PositionLeftUnitsValue; } + void positionLeftUnitsValue(uint32_t value) + { + if (m_PositionLeftUnitsValue == value) + { + return; + } + m_PositionLeftUnitsValue = value; + positionLeftUnitsValueChanged(); + } + + inline uint32_t positionRightUnitsValue() const { return m_PositionRightUnitsValue; } + void positionRightUnitsValue(uint32_t value) + { + if (m_PositionRightUnitsValue == value) + { + return; + } + m_PositionRightUnitsValue = value; + positionRightUnitsValueChanged(); + } + + inline uint32_t positionTopUnitsValue() const { return m_PositionTopUnitsValue; } + void positionTopUnitsValue(uint32_t value) + { + if (m_PositionTopUnitsValue == value) + { + return; + } + m_PositionTopUnitsValue = value; + positionTopUnitsValueChanged(); + } + + inline uint32_t positionBottomUnitsValue() const { return m_PositionBottomUnitsValue; } + void positionBottomUnitsValue(uint32_t value) + { + if (m_PositionBottomUnitsValue == value) + { + return; + } + m_PositionBottomUnitsValue = value; + positionBottomUnitsValueChanged(); + } + + inline uint32_t gapHorizontalUnitsValue() const { return m_GapHorizontalUnitsValue; } + void gapHorizontalUnitsValue(uint32_t value) + { + if (m_GapHorizontalUnitsValue == value) + { + return; + } + m_GapHorizontalUnitsValue = value; + gapHorizontalUnitsValueChanged(); + } + + inline uint32_t gapVerticalUnitsValue() const { return m_GapVerticalUnitsValue; } + void gapVerticalUnitsValue(uint32_t value) + { + if (m_GapVerticalUnitsValue == value) + { + return; + } + m_GapVerticalUnitsValue = value; + gapVerticalUnitsValueChanged(); + } + + inline uint32_t minWidthUnitsValue() const { return m_MinWidthUnitsValue; } + void minWidthUnitsValue(uint32_t value) + { + if (m_MinWidthUnitsValue == value) + { + return; + } + m_MinWidthUnitsValue = value; + minWidthUnitsValueChanged(); + } + + inline uint32_t minHeightUnitsValue() const { return m_MinHeightUnitsValue; } + void minHeightUnitsValue(uint32_t value) + { + if (m_MinHeightUnitsValue == value) + { + return; + } + m_MinHeightUnitsValue = value; + minHeightUnitsValueChanged(); + } + + inline uint32_t maxWidthUnitsValue() const { return m_MaxWidthUnitsValue; } + void maxWidthUnitsValue(uint32_t value) + { + if (m_MaxWidthUnitsValue == value) + { + return; + } + m_MaxWidthUnitsValue = value; + maxWidthUnitsValueChanged(); + } + + inline uint32_t maxHeightUnitsValue() const { return m_MaxHeightUnitsValue; } + void maxHeightUnitsValue(uint32_t value) + { + if (m_MaxHeightUnitsValue == value) + { + return; + } + m_MaxHeightUnitsValue = value; + maxHeightUnitsValueChanged(); + } + Core* clone() const override; void copy(const LayoutComponentStyleBase& object) { - m_LayoutFlags0 = object.m_LayoutFlags0; - m_LayoutFlags1 = object.m_LayoutFlags1; - m_LayoutFlags2 = object.m_LayoutFlags2; m_GapHorizontal = object.m_GapHorizontal; m_GapVertical = object.m_GapVertical; m_MaxWidth = object.m_MaxWidth; @@ -522,10 +949,46 @@ m_FlexBasis = object.m_FlexBasis; m_AspectRatio = object.m_AspectRatio; m_ScaleType = object.m_ScaleType; + m_LayoutAlignmentType = object.m_LayoutAlignmentType; m_AnimationStyleType = object.m_AnimationStyleType; m_InterpolationType = object.m_InterpolationType; m_InterpolatorId = object.m_InterpolatorId; m_InterpolationTime = object.m_InterpolationTime; + m_DisplayValue = object.m_DisplayValue; + m_PositionTypeValue = object.m_PositionTypeValue; + m_FlexDirectionValue = object.m_FlexDirectionValue; + m_DirectionValue = object.m_DirectionValue; + m_AlignContentValue = object.m_AlignContentValue; + m_AlignItemsValue = object.m_AlignItemsValue; + m_AlignSelfValue = object.m_AlignSelfValue; + m_JustifyContentValue = object.m_JustifyContentValue; + m_FlexWrapValue = object.m_FlexWrapValue; + m_OverflowValue = object.m_OverflowValue; + m_IntrinsicallySizedValue = object.m_IntrinsicallySizedValue; + m_WidthUnitsValue = object.m_WidthUnitsValue; + m_HeightUnitsValue = object.m_HeightUnitsValue; + m_BorderLeftUnitsValue = object.m_BorderLeftUnitsValue; + m_BorderRightUnitsValue = object.m_BorderRightUnitsValue; + m_BorderTopUnitsValue = object.m_BorderTopUnitsValue; + m_BorderBottomUnitsValue = object.m_BorderBottomUnitsValue; + m_MarginLeftUnitsValue = object.m_MarginLeftUnitsValue; + m_MarginRightUnitsValue = object.m_MarginRightUnitsValue; + m_MarginTopUnitsValue = object.m_MarginTopUnitsValue; + m_MarginBottomUnitsValue = object.m_MarginBottomUnitsValue; + m_PaddingLeftUnitsValue = object.m_PaddingLeftUnitsValue; + m_PaddingRightUnitsValue = object.m_PaddingRightUnitsValue; + m_PaddingTopUnitsValue = object.m_PaddingTopUnitsValue; + m_PaddingBottomUnitsValue = object.m_PaddingBottomUnitsValue; + m_PositionLeftUnitsValue = object.m_PositionLeftUnitsValue; + m_PositionRightUnitsValue = object.m_PositionRightUnitsValue; + m_PositionTopUnitsValue = object.m_PositionTopUnitsValue; + m_PositionBottomUnitsValue = object.m_PositionBottomUnitsValue; + m_GapHorizontalUnitsValue = object.m_GapHorizontalUnitsValue; + m_GapVerticalUnitsValue = object.m_GapVerticalUnitsValue; + m_MinWidthUnitsValue = object.m_MinWidthUnitsValue; + m_MinHeightUnitsValue = object.m_MinHeightUnitsValue; + m_MaxWidthUnitsValue = object.m_MaxWidthUnitsValue; + m_MaxHeightUnitsValue = object.m_MaxHeightUnitsValue; Component::copy(object); } @@ -533,15 +996,6 @@ { switch (propertyKey) { - case layoutFlags0PropertyKey: - m_LayoutFlags0 = CoreUintType::deserialize(reader); - return true; - case layoutFlags1PropertyKey: - m_LayoutFlags1 = CoreUintType::deserialize(reader); - return true; - case layoutFlags2PropertyKey: - m_LayoutFlags2 = CoreUintType::deserialize(reader); - return true; case gapHorizontalPropertyKey: m_GapHorizontal = CoreDoubleType::deserialize(reader); return true; @@ -626,6 +1080,9 @@ case scaleTypePropertyKey: m_ScaleType = CoreUintType::deserialize(reader); return true; + case layoutAlignmentTypePropertyKey: + m_LayoutAlignmentType = CoreUintType::deserialize(reader); + return true; case animationStyleTypePropertyKey: m_AnimationStyleType = CoreUintType::deserialize(reader); return true; @@ -638,14 +1095,116 @@ case interpolationTimePropertyKey: m_InterpolationTime = CoreDoubleType::deserialize(reader); return true; + case displayValuePropertyKey: + m_DisplayValue = CoreUintType::deserialize(reader); + return true; + case positionTypeValuePropertyKey: + m_PositionTypeValue = CoreUintType::deserialize(reader); + return true; + case flexDirectionValuePropertyKey: + m_FlexDirectionValue = CoreUintType::deserialize(reader); + return true; + case directionValuePropertyKey: + m_DirectionValue = CoreUintType::deserialize(reader); + return true; + case alignContentValuePropertyKey: + m_AlignContentValue = CoreUintType::deserialize(reader); + return true; + case alignItemsValuePropertyKey: + m_AlignItemsValue = CoreUintType::deserialize(reader); + return true; + case alignSelfValuePropertyKey: + m_AlignSelfValue = CoreUintType::deserialize(reader); + return true; + case justifyContentValuePropertyKey: + m_JustifyContentValue = CoreUintType::deserialize(reader); + return true; + case flexWrapValuePropertyKey: + m_FlexWrapValue = CoreUintType::deserialize(reader); + return true; + case overflowValuePropertyKey: + m_OverflowValue = CoreUintType::deserialize(reader); + return true; + case intrinsicallySizedValuePropertyKey: + m_IntrinsicallySizedValue = CoreBoolType::deserialize(reader); + return true; + case widthUnitsValuePropertyKey: + m_WidthUnitsValue = CoreUintType::deserialize(reader); + return true; + case heightUnitsValuePropertyKey: + m_HeightUnitsValue = CoreUintType::deserialize(reader); + return true; + case borderLeftUnitsValuePropertyKey: + m_BorderLeftUnitsValue = CoreUintType::deserialize(reader); + return true; + case borderRightUnitsValuePropertyKey: + m_BorderRightUnitsValue = CoreUintType::deserialize(reader); + return true; + case borderTopUnitsValuePropertyKey: + m_BorderTopUnitsValue = CoreUintType::deserialize(reader); + return true; + case borderBottomUnitsValuePropertyKey: + m_BorderBottomUnitsValue = CoreUintType::deserialize(reader); + return true; + case marginLeftUnitsValuePropertyKey: + m_MarginLeftUnitsValue = CoreUintType::deserialize(reader); + return true; + case marginRightUnitsValuePropertyKey: + m_MarginRightUnitsValue = CoreUintType::deserialize(reader); + return true; + case marginTopUnitsValuePropertyKey: + m_MarginTopUnitsValue = CoreUintType::deserialize(reader); + return true; + case marginBottomUnitsValuePropertyKey: + m_MarginBottomUnitsValue = CoreUintType::deserialize(reader); + return true; + case paddingLeftUnitsValuePropertyKey: + m_PaddingLeftUnitsValue = CoreUintType::deserialize(reader); + return true; + case paddingRightUnitsValuePropertyKey: + m_PaddingRightUnitsValue = CoreUintType::deserialize(reader); + return true; + case paddingTopUnitsValuePropertyKey: + m_PaddingTopUnitsValue = CoreUintType::deserialize(reader); + return true; + case paddingBottomUnitsValuePropertyKey: + m_PaddingBottomUnitsValue = CoreUintType::deserialize(reader); + return true; + case positionLeftUnitsValuePropertyKey: + m_PositionLeftUnitsValue = CoreUintType::deserialize(reader); + return true; + case positionRightUnitsValuePropertyKey: + m_PositionRightUnitsValue = CoreUintType::deserialize(reader); + return true; + case positionTopUnitsValuePropertyKey: + m_PositionTopUnitsValue = CoreUintType::deserialize(reader); + return true; + case positionBottomUnitsValuePropertyKey: + m_PositionBottomUnitsValue = CoreUintType::deserialize(reader); + return true; + case gapHorizontalUnitsValuePropertyKey: + m_GapHorizontalUnitsValue = CoreUintType::deserialize(reader); + return true; + case gapVerticalUnitsValuePropertyKey: + m_GapVerticalUnitsValue = CoreUintType::deserialize(reader); + return true; + case minWidthUnitsValuePropertyKey: + m_MinWidthUnitsValue = CoreUintType::deserialize(reader); + return true; + case minHeightUnitsValuePropertyKey: + m_MinHeightUnitsValue = CoreUintType::deserialize(reader); + return true; + case maxWidthUnitsValuePropertyKey: + m_MaxWidthUnitsValue = CoreUintType::deserialize(reader); + return true; + case maxHeightUnitsValuePropertyKey: + m_MaxHeightUnitsValue = CoreUintType::deserialize(reader); + return true; } return Component::deserialize(propertyKey, reader); } protected: - virtual void layoutFlags0Changed() {} - virtual void layoutFlags1Changed() {} - virtual void layoutFlags2Changed() {} virtual void gapHorizontalChanged() {} virtual void gapVerticalChanged() {} virtual void maxWidthChanged() {} @@ -674,10 +1233,46 @@ virtual void flexBasisChanged() {} virtual void aspectRatioChanged() {} virtual void scaleTypeChanged() {} + virtual void layoutAlignmentTypeChanged() {} virtual void animationStyleTypeChanged() {} virtual void interpolationTypeChanged() {} virtual void interpolatorIdChanged() {} virtual void interpolationTimeChanged() {} + virtual void displayValueChanged() {} + virtual void positionTypeValueChanged() {} + virtual void flexDirectionValueChanged() {} + virtual void directionValueChanged() {} + virtual void alignContentValueChanged() {} + virtual void alignItemsValueChanged() {} + virtual void alignSelfValueChanged() {} + virtual void justifyContentValueChanged() {} + virtual void flexWrapValueChanged() {} + virtual void overflowValueChanged() {} + virtual void intrinsicallySizedValueChanged() {} + virtual void widthUnitsValueChanged() {} + virtual void heightUnitsValueChanged() {} + virtual void borderLeftUnitsValueChanged() {} + virtual void borderRightUnitsValueChanged() {} + virtual void borderTopUnitsValueChanged() {} + virtual void borderBottomUnitsValueChanged() {} + virtual void marginLeftUnitsValueChanged() {} + virtual void marginRightUnitsValueChanged() {} + virtual void marginTopUnitsValueChanged() {} + virtual void marginBottomUnitsValueChanged() {} + virtual void paddingLeftUnitsValueChanged() {} + virtual void paddingRightUnitsValueChanged() {} + virtual void paddingTopUnitsValueChanged() {} + virtual void paddingBottomUnitsValueChanged() {} + virtual void positionLeftUnitsValueChanged() {} + virtual void positionRightUnitsValueChanged() {} + virtual void positionTopUnitsValueChanged() {} + virtual void positionBottomUnitsValueChanged() {} + virtual void gapHorizontalUnitsValueChanged() {} + virtual void gapVerticalUnitsValueChanged() {} + virtual void minWidthUnitsValueChanged() {} + virtual void minHeightUnitsValueChanged() {} + virtual void maxWidthUnitsValueChanged() {} + virtual void maxHeightUnitsValueChanged() {} }; } // namespace rive
diff --git a/include/rive/layout/layout_component_style.hpp b/include/rive/layout/layout_component_style.hpp index 4b8c0ff..861545d 100644 --- a/include/rive/layout/layout_component_style.hpp +++ b/include/rive/layout/layout_component_style.hpp
@@ -1,54 +1,12 @@ #ifndef _RIVE_LAYOUT_COMPONENT_STYLE_HPP_ #define _RIVE_LAYOUT_COMPONENT_STYLE_HPP_ #include "rive/generated/layout/layout_component_style_base.hpp" -#include "rive/math/bit_field_loc.hpp" #ifdef WITH_RIVE_LAYOUT #include "yoga/Yoga.h" #endif #include <stdio.h> namespace rive { -// ---- Flags 0 -extern BitFieldLoc DisplayBits; -extern BitFieldLoc PositionTypeBits; -extern BitFieldLoc FlexDirectionBits; -extern BitFieldLoc DirectionBits; -extern BitFieldLoc AlignContentBits; -extern BitFieldLoc AlignItemsBits; -extern BitFieldLoc AlignSelfBits; -extern BitFieldLoc JustifyContentBits; -extern BitFieldLoc FlexWrapBits; -extern BitFieldLoc OverflowBits; -extern BitFieldLoc IntrinsicallySizedBits; -extern BitFieldLoc WidthUnitsBits; -extern BitFieldLoc HeightUnitsBits; - -// ---- Flags 1 -extern BitFieldLoc BorderLeftUnitsBits; -extern BitFieldLoc BorderRightUnitsBits; -extern BitFieldLoc BorderTopUnitsBits; -extern BitFieldLoc BorderBottomUnitsBits; -extern BitFieldLoc MarginLeftUnitsBits; -extern BitFieldLoc MarginRightUnitsBits; -extern BitFieldLoc MarginTopUnitsBits; -extern BitFieldLoc MarginBottomUnitsBits; -extern BitFieldLoc PaddingLeftUnitsBits; -extern BitFieldLoc PaddingRightUnitsBits; -extern BitFieldLoc PaddingTopUnitsBits; -extern BitFieldLoc PaddingBottomUnitsBits; -extern BitFieldLoc PositionLeftUnitsBits; -extern BitFieldLoc PositionRightUnitsBits; -extern BitFieldLoc PositionTopUnitsBits; -extern BitFieldLoc PositionBottomUnitsBits; - -// ---- Flags 2 -extern BitFieldLoc GapHorizontalUnitsBits; -extern BitFieldLoc GapVerticalUnitsBits; -extern BitFieldLoc MinWidthUnitsBits; -extern BitFieldLoc MinHeightUnitsBits; -extern BitFieldLoc MaxWidthUnitsBits; -extern BitFieldLoc MaxHeightUnitsBits; - enum class LayoutAnimationStyle : uint8_t { none, @@ -64,6 +22,22 @@ elastic }; +enum class LayoutAlignmentType : uint8_t +{ + topLeft, + topCenter, + topRight, + centerLeft, + center, + centerRight, + bottomLeft, + bottomCenter, + bottomRight, + spaceBetweenStart, + spaceBetweenCenter, + spaceBetweenEnd +}; + class KeyFrameInterpolator; class LayoutComponentStyle : public LayoutComponentStyleBase { @@ -82,6 +56,7 @@ LayoutAnimationStyle animationStyle(); YGDisplay display(); YGPositionType positionType(); + LayoutAlignmentType alignmentType(); YGFlexDirection flexDirection(); YGDirection direction(); @@ -124,9 +99,18 @@ void markLayoutNodeDirty(); void markLayoutStyleDirty(); - void layoutFlags0Changed() override; - void layoutFlags1Changed() override; - void layoutFlags2Changed() override; + void layoutAlignmentTypeChanged() override; + void displayValueChanged() override; + void positionTypeValueChanged() override; + void overflowValueChanged() override; + void intrinsicallySizedValueChanged() override; + void flexDirectionValueChanged() override; + void directionValueChanged() override; + void alignContentValueChanged() override; + void alignItemsValueChanged() override; + void alignSelfValueChanged() override; + void justifyContentValueChanged() override; + void flexWrapValueChanged() override; void flexChanged() override; void flexGrowChanged() override; void flexShrinkChanged() override; @@ -154,6 +138,31 @@ void positionRightChanged() override; void positionTopChanged() override; void positionBottomChanged() override; + + void widthUnitsValueChanged() override; + void heightUnitsValueChanged() override; + void gapHorizontalUnitsValueChanged() override; + void gapVerticalUnitsValueChanged() override; + void maxWidthUnitsValueChanged() override; + void maxHeightUnitsValueChanged() override; + void minWidthUnitsValueChanged() override; + void minHeightUnitsValueChanged() override; + void borderLeftUnitsValueChanged() override; + void borderRightUnitsValueChanged() override; + void borderTopUnitsValueChanged() override; + void borderBottomUnitsValueChanged() override; + void marginLeftUnitsValueChanged() override; + void marginRightUnitsValueChanged() override; + void marginTopUnitsValueChanged() override; + void marginBottomUnitsValueChanged() override; + void paddingLeftUnitsValueChanged() override; + void paddingRightUnitsValueChanged() override; + void paddingTopUnitsValueChanged() override; + void paddingBottomUnitsValueChanged() override; + void positionLeftUnitsValueChanged() override; + void positionRightUnitsValueChanged() override; + void positionTopUnitsValueChanged() override; + void positionBottomUnitsValueChanged() override; }; } // namespace rive
diff --git a/include/rive/layout_component.hpp b/include/rive/layout_component.hpp index 4a5be75..6b6e31a 100644 --- a/include/rive/layout_component.hpp +++ b/include/rive/layout_component.hpp
@@ -85,13 +85,18 @@ KeyFrameInterpolator* inheritedInterpolator, float inheritedInterpolationTime); void clearInheritedInterpolation(); - AABB layoutBounds() + virtual AABB layoutBounds() { return AABB(m_layoutLocationX, m_layoutLocationY, m_layoutLocationX + m_layoutSizeWidth, m_layoutLocationY + m_layoutSizeHeight); - } + }; + bool hasLayoutMeasurements() + { + return m_layoutLocationX != 0 || m_layoutLocationY != 0 || m_layoutSizeWidth != 0 || + m_layoutSizeHeight != 0; + }; #endif void buildDependencies() override;
diff --git a/src/animation/keyframe_uint.cpp b/src/animation/keyframe_uint.cpp new file mode 100644 index 0000000..398abe3 --- /dev/null +++ b/src/animation/keyframe_uint.cpp
@@ -0,0 +1,18 @@ +#include "rive/animation/keyframe_uint.hpp" +#include "rive/generated/core_registry.hpp" + +using namespace rive; + +void KeyFrameUint::apply(Core* object, int propertyKey, float mix) +{ + CoreRegistry::setUint(object, propertyKey, value()); +} + +void KeyFrameUint::applyInterpolation(Core* object, + int propertyKey, + float currentTime, + const KeyFrame* nextFrame, + float mix) +{ + CoreRegistry::setUint(object, propertyKey, value()); +} \ No newline at end of file
diff --git a/src/generated/animation/keyframe_uint_base.cpp b/src/generated/animation/keyframe_uint_base.cpp new file mode 100644 index 0000000..35ddbed --- /dev/null +++ b/src/generated/animation/keyframe_uint_base.cpp
@@ -0,0 +1,11 @@ +#include "rive/generated/animation/keyframe_uint_base.hpp" +#include "rive/animation/keyframe_uint.hpp" + +using namespace rive; + +Core* KeyFrameUintBase::clone() const +{ + auto cloned = new KeyFrameUint(); + cloned->copy(*this); + return cloned; +}
diff --git a/src/layout/layout_component_style.cpp b/src/layout/layout_component_style.cpp index 325e92a..8fe4a32 100644 --- a/src/layout/layout_component_style.cpp +++ b/src/layout/layout_component_style.cpp
@@ -6,47 +6,6 @@ using namespace rive; -// ---- Flags 0 -BitFieldLoc rive::DisplayBits = BitFieldLoc(0, 0); -BitFieldLoc rive::PositionTypeBits = BitFieldLoc(1, 2); -BitFieldLoc rive::FlexDirectionBits = BitFieldLoc(3, 4); -BitFieldLoc rive::DirectionBits = BitFieldLoc(5, 6); -BitFieldLoc rive::AlignContentBits = BitFieldLoc(7, 9); -BitFieldLoc rive::AlignItemsBits = BitFieldLoc(10, 12); -BitFieldLoc rive::AlignSelfBits = BitFieldLoc(13, 15); -BitFieldLoc rive::JustifyContentBits = BitFieldLoc(16, 18); -BitFieldLoc rive::FlexWrapBits = BitFieldLoc(19, 20); -BitFieldLoc rive::OverflowBits = BitFieldLoc(21, 22); -BitFieldLoc rive::IntrinsicallySizedBits = BitFieldLoc(23, 23); -BitFieldLoc rive::WidthUnitsBits = BitFieldLoc(24, 25); -BitFieldLoc rive::HeightUnitsBits = BitFieldLoc(26, 27); - -// ---- Flags 1 -BitFieldLoc rive::BorderLeftUnitsBits = BitFieldLoc(0, 1); -BitFieldLoc rive::BorderRightUnitsBits = BitFieldLoc(2, 3); -BitFieldLoc rive::BorderTopUnitsBits = BitFieldLoc(4, 5); -BitFieldLoc rive::BorderBottomUnitsBits = BitFieldLoc(6, 7); -BitFieldLoc rive::MarginLeftUnitsBits = BitFieldLoc(8, 9); -BitFieldLoc rive::MarginRightUnitsBits = BitFieldLoc(10, 11); -BitFieldLoc rive::MarginTopUnitsBits = BitFieldLoc(12, 13); -BitFieldLoc rive::MarginBottomUnitsBits = BitFieldLoc(14, 15); -BitFieldLoc rive::PaddingLeftUnitsBits = BitFieldLoc(16, 17); -BitFieldLoc rive::PaddingRightUnitsBits = BitFieldLoc(18, 19); -BitFieldLoc rive::PaddingTopUnitsBits = BitFieldLoc(20, 21); -BitFieldLoc rive::PaddingBottomUnitsBits = BitFieldLoc(22, 23); -BitFieldLoc rive::PositionLeftUnitsBits = BitFieldLoc(24, 25); -BitFieldLoc rive::PositionRightUnitsBits = BitFieldLoc(26, 27); -BitFieldLoc rive::PositionTopUnitsBits = BitFieldLoc(28, 29); -BitFieldLoc rive::PositionBottomUnitsBits = BitFieldLoc(30, 31); - -// ---- Flags 2 -BitFieldLoc rive::GapHorizontalUnitsBits = BitFieldLoc(0, 1); -BitFieldLoc rive::GapVerticalUnitsBits = BitFieldLoc(2, 3); -BitFieldLoc rive::MinWidthUnitsBits = BitFieldLoc(4, 5); -BitFieldLoc rive::MinHeightUnitsBits = BitFieldLoc(6, 7); -BitFieldLoc rive::MaxWidthUnitsBits = BitFieldLoc(8, 9); -BitFieldLoc rive::MaxHeightUnitsBits = BitFieldLoc(10, 11); - #ifdef WITH_RIVE_LAYOUT KeyFrameInterpolator* LayoutComponentStyle::interpolator() { return m_interpolator; } @@ -61,161 +20,82 @@ return LayoutAnimationStyle(animationStyleType()); } -YGDisplay LayoutComponentStyle::display() { return YGDisplay(DisplayBits.read(layoutFlags0())); } - -YGPositionType LayoutComponentStyle::positionType() +LayoutAlignmentType LayoutComponentStyle::alignmentType() { - return YGPositionType(PositionTypeBits.read(layoutFlags0())); + return LayoutAlignmentType(layoutAlignmentType()); } +YGDisplay LayoutComponentStyle::display() { return YGDisplay(displayValue()); } + +YGPositionType LayoutComponentStyle::positionType() { return YGPositionType(positionTypeValue()); } + YGFlexDirection LayoutComponentStyle::flexDirection() { - return YGFlexDirection(FlexDirectionBits.read(layoutFlags0())); + return YGFlexDirection(flexDirectionValue()); } -YGDirection LayoutComponentStyle::direction() -{ - return YGDirection(DirectionBits.read(layoutFlags0())); -} +YGDirection LayoutComponentStyle::direction() { return YGDirection(directionValue()); } -YGWrap LayoutComponentStyle::flexWrap() { return YGWrap(FlexWrapBits.read(layoutFlags0())); } +YGWrap LayoutComponentStyle::flexWrap() { return YGWrap(flexWrapValue()); } -YGAlign LayoutComponentStyle::alignItems() { return YGAlign(AlignItemsBits.read(layoutFlags0())); } +YGAlign LayoutComponentStyle::alignItems() { return YGAlign(alignItemsValue()); } -YGAlign LayoutComponentStyle::alignSelf() { return YGAlign(AlignSelfBits.read(layoutFlags0())); } +YGAlign LayoutComponentStyle::alignSelf() { return YGAlign(alignSelfValue()); } -YGAlign LayoutComponentStyle::alignContent() -{ - return YGAlign(AlignContentBits.read(layoutFlags0())); -} +YGAlign LayoutComponentStyle::alignContent() { return YGAlign(alignContentValue()); } -YGJustify LayoutComponentStyle::justifyContent() -{ - return YGJustify(JustifyContentBits.read(layoutFlags0())); -} +YGJustify LayoutComponentStyle::justifyContent() { return YGJustify(justifyContentValue()); } -YGOverflow LayoutComponentStyle::overflow() -{ - return YGOverflow(OverflowBits.read(layoutFlags0())); -} +YGOverflow LayoutComponentStyle::overflow() { return YGOverflow(overflowValue()); } -bool LayoutComponentStyle::intrinsicallySized() -{ - return IntrinsicallySizedBits.read(layoutFlags0()) == 1; -} +bool LayoutComponentStyle::intrinsicallySized() { return intrinsicallySizedValue() == 1; } -YGUnit LayoutComponentStyle::widthUnits() { return YGUnit(WidthUnitsBits.read(layoutFlags0())); } +YGUnit LayoutComponentStyle::widthUnits() { return YGUnit(widthUnitsValue()); } -YGUnit LayoutComponentStyle::heightUnits() { return YGUnit(HeightUnitsBits.read(layoutFlags0())); } +YGUnit LayoutComponentStyle::heightUnits() { return YGUnit(heightUnitsValue()); } -YGUnit LayoutComponentStyle::borderLeftUnits() -{ - return YGUnit(BorderLeftUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::borderLeftUnits() { return YGUnit(borderLeftUnitsValue()); } -YGUnit LayoutComponentStyle::borderRightUnits() -{ - return YGUnit(BorderRightUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::borderRightUnits() { return YGUnit(borderRightUnitsValue()); } -YGUnit LayoutComponentStyle::borderTopUnits() -{ - return YGUnit(BorderTopUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::borderTopUnits() { return YGUnit(borderTopUnitsValue()); } -YGUnit LayoutComponentStyle::borderBottomUnits() -{ - return YGUnit(BorderBottomUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::borderBottomUnits() { return YGUnit(borderBottomUnitsValue()); } -YGUnit LayoutComponentStyle::marginLeftUnits() -{ - return YGUnit(MarginLeftUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::marginLeftUnits() { return YGUnit(marginLeftUnitsValue()); } -YGUnit LayoutComponentStyle::marginRightUnits() -{ - return YGUnit(MarginRightUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::marginRightUnits() { return YGUnit(marginRightUnitsValue()); } -YGUnit LayoutComponentStyle::marginTopUnits() -{ - return YGUnit(MarginTopUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::marginTopUnits() { return YGUnit(marginTopUnitsValue()); } -YGUnit LayoutComponentStyle::marginBottomUnits() -{ - return YGUnit(MarginBottomUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::marginBottomUnits() { return YGUnit(marginBottomUnitsValue()); } -YGUnit LayoutComponentStyle::paddingLeftUnits() -{ - return YGUnit(PaddingLeftUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::paddingLeftUnits() { return YGUnit(paddingLeftUnitsValue()); } -YGUnit LayoutComponentStyle::paddingRightUnits() -{ - return YGUnit(PaddingRightUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::paddingRightUnits() { return YGUnit(paddingRightUnitsValue()); } -YGUnit LayoutComponentStyle::paddingTopUnits() -{ - return YGUnit(PaddingTopUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::paddingTopUnits() { return YGUnit(paddingTopUnitsValue()); } -YGUnit LayoutComponentStyle::paddingBottomUnits() -{ - return YGUnit(PaddingBottomUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::paddingBottomUnits() { return YGUnit(paddingBottomUnitsValue()); } -YGUnit LayoutComponentStyle::positionLeftUnits() -{ - return YGUnit(PositionLeftUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::positionLeftUnits() { return YGUnit(positionLeftUnitsValue()); } -YGUnit LayoutComponentStyle::positionRightUnits() -{ - return YGUnit(PositionRightUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::positionRightUnits() { return YGUnit(positionRightUnitsValue()); } -YGUnit LayoutComponentStyle::positionTopUnits() -{ - return YGUnit(PositionTopUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::positionTopUnits() { return YGUnit(positionTopUnitsValue()); } -YGUnit LayoutComponentStyle::positionBottomUnits() -{ - return YGUnit(PositionBottomUnitsBits.read(layoutFlags1())); -} +YGUnit LayoutComponentStyle::positionBottomUnits() { return YGUnit(positionBottomUnitsValue()); } -YGUnit LayoutComponentStyle::gapHorizontalUnits() -{ - return YGUnit(GapHorizontalUnitsBits.read(layoutFlags2())); -} +YGUnit LayoutComponentStyle::gapHorizontalUnits() { return YGUnit(gapHorizontalUnitsValue()); } -YGUnit LayoutComponentStyle::gapVerticalUnits() -{ - return YGUnit(GapVerticalUnitsBits.read(layoutFlags2())); -} +YGUnit LayoutComponentStyle::gapVerticalUnits() { return YGUnit(gapVerticalUnitsValue()); } -YGUnit LayoutComponentStyle::maxWidthUnits() -{ - return YGUnit(MaxWidthUnitsBits.read(layoutFlags2())); -} +YGUnit LayoutComponentStyle::maxWidthUnits() { return YGUnit(maxWidthUnitsValue()); } -YGUnit LayoutComponentStyle::maxHeightUnits() -{ - return YGUnit(MaxHeightUnitsBits.read(layoutFlags2())); -} +YGUnit LayoutComponentStyle::maxHeightUnits() { return YGUnit(maxHeightUnitsValue()); } -YGUnit LayoutComponentStyle::minWidthUnits() -{ - return YGUnit(MinWidthUnitsBits.read(layoutFlags2())); -} -YGUnit LayoutComponentStyle::minHeightUnits() -{ - return YGUnit(MinHeightUnitsBits.read(layoutFlags2())); -} +YGUnit LayoutComponentStyle::minWidthUnits() { return YGUnit(minWidthUnitsValue()); } +YGUnit LayoutComponentStyle::minHeightUnits() { return YGUnit(minHeightUnitsValue()); } void LayoutComponentStyle::markLayoutNodeDirty() { if (parent()->is<LayoutComponent>()) @@ -252,9 +132,19 @@ void LayoutComponentStyle::markLayoutStyleDirty() {} #endif -void LayoutComponentStyle::layoutFlags0Changed() { markLayoutNodeDirty(); } -void LayoutComponentStyle::layoutFlags1Changed() { markLayoutNodeDirty(); } -void LayoutComponentStyle::layoutFlags2Changed() { markLayoutNodeDirty(); } +void LayoutComponentStyle::layoutAlignmentTypeChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::displayValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::positionTypeValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::overflowValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::intrinsicallySizedValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::flexDirectionValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::directionValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::alignContentValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::alignItemsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::alignSelfValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::justifyContentValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::flexWrapValueChanged() { markLayoutNodeDirty(); } + void LayoutComponentStyle::flexChanged() { markLayoutNodeDirty(); } void LayoutComponentStyle::flexGrowChanged() { markLayoutNodeDirty(); } void LayoutComponentStyle::flexShrinkChanged() { markLayoutNodeDirty(); } @@ -281,4 +171,29 @@ void LayoutComponentStyle::positionLeftChanged() { markLayoutNodeDirty(); } void LayoutComponentStyle::positionRightChanged() { markLayoutNodeDirty(); } void LayoutComponentStyle::positionTopChanged() { markLayoutNodeDirty(); } -void LayoutComponentStyle::positionBottomChanged() { markLayoutNodeDirty(); } \ No newline at end of file +void LayoutComponentStyle::positionBottomChanged() { markLayoutNodeDirty(); } + +void LayoutComponentStyle::widthUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::heightUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::gapHorizontalUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::gapVerticalUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::maxWidthUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::maxHeightUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::minWidthUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::minHeightUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::borderLeftUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::borderRightUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::borderTopUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::borderBottomUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::marginLeftUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::marginRightUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::marginTopUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::marginBottomUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::paddingLeftUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::paddingRightUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::paddingTopUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::paddingBottomUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::positionLeftUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::positionRightUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::positionTopUnitsValueChanged() { markLayoutNodeDirty(); } +void LayoutComponentStyle::positionBottomUnitsValueChanged() { markLayoutNodeDirty(); } \ No newline at end of file
diff --git a/src/layout_component.cpp b/src/layout_component.cpp index bf32da9..2f393e2 100644 --- a/src/layout_component.cpp +++ b/src/layout_component.cpp
@@ -138,6 +138,96 @@ { ygStyle.dimensions()[YGDimensionHeight] = YGValueAuto; } + + bool isRowForAlignment = m_style->flexDirection() == YGFlexDirectionRow || + m_style->flexDirection() == YGFlexDirectionRowReverse; + switch (m_style->alignmentType()) + { + case LayoutAlignmentType::topLeft: + case LayoutAlignmentType::topCenter: + case LayoutAlignmentType::topRight: + case LayoutAlignmentType::spaceBetweenStart: + if (isRowForAlignment) + { + ygStyle.alignItems() = YGAlignFlexStart; + } + else + { + ygStyle.justifyContent() = YGJustifyFlexStart; + } + break; + case LayoutAlignmentType::centerLeft: + case LayoutAlignmentType::center: + case LayoutAlignmentType::centerRight: + case LayoutAlignmentType::spaceBetweenCenter: + if (isRowForAlignment) + { + ygStyle.alignItems() = YGAlignCenter; + } + else + { + ygStyle.justifyContent() = YGJustifyCenter; + } + break; + case LayoutAlignmentType::bottomLeft: + case LayoutAlignmentType::bottomCenter: + case LayoutAlignmentType::bottomRight: + case LayoutAlignmentType::spaceBetweenEnd: + if (isRowForAlignment) + { + ygStyle.alignItems() = YGAlignFlexEnd; + } + else + { + ygStyle.justifyContent() = YGJustifyFlexEnd; + } + break; + } + switch (m_style->alignmentType()) + { + case LayoutAlignmentType::topLeft: + case LayoutAlignmentType::centerLeft: + case LayoutAlignmentType::bottomLeft: + if (isRowForAlignment) + { + ygStyle.justifyContent() = YGJustifyFlexStart; + } + else + { + ygStyle.alignItems() = YGAlignFlexStart; + } + break; + case LayoutAlignmentType::topCenter: + case LayoutAlignmentType::center: + case LayoutAlignmentType::bottomCenter: + if (isRowForAlignment) + { + ygStyle.justifyContent() = YGJustifyCenter; + } + else + { + ygStyle.alignItems() = YGAlignCenter; + } + break; + case LayoutAlignmentType::topRight: + case LayoutAlignmentType::centerRight: + case LayoutAlignmentType::bottomRight: + if (isRowForAlignment) + { + ygStyle.justifyContent() = YGJustifyFlexEnd; + } + else + { + ygStyle.alignItems() = YGAlignFlexEnd; + } + break; + case LayoutAlignmentType::spaceBetweenStart: + case LayoutAlignmentType::spaceBetweenCenter: + case LayoutAlignmentType::spaceBetweenEnd: + ygStyle.justifyContent() = YGJustifySpaceBetween; + break; + } + ygStyle.minDimensions()[YGDimensionWidth] = YGValue{m_style->minWidth(), m_style->minWidthUnits()}; ygStyle.minDimensions()[YGDimensionHeight] = @@ -178,10 +268,10 @@ // ygStyle.flexBasis() = m_style->flexBasis(); ygStyle.flexDirection() = m_style->flexDirection(); ygStyle.flexWrap() = m_style->flexWrap(); - ygStyle.alignItems() = m_style->alignItems(); - ygStyle.alignContent() = m_style->alignContent(); + // ygStyle.alignItems() = m_style->alignItems(); + // ygStyle.alignContent() = m_style->alignContent(); ygStyle.alignSelf() = m_style->alignSelf(); - ygStyle.justifyContent() = m_style->justifyContent(); + // ygStyle.justifyContent() = m_style->justifyContent(); ygNode.setStyle(ygStyle); }
diff --git a/test/assets/layout/layout_center.riv b/test/assets/layout/layout_center.riv index f64c66c..4b57961 100644 --- a/test/assets/layout/layout_center.riv +++ b/test/assets/layout/layout_center.riv Binary files differ
diff --git a/test/assets/layout/layout_horizontal.riv b/test/assets/layout/layout_horizontal.riv index 7813fa9..ad9e1b0 100644 --- a/test/assets/layout/layout_horizontal.riv +++ b/test/assets/layout/layout_horizontal.riv Binary files differ
diff --git a/test/assets/layout/layout_horizontal_gaps.riv b/test/assets/layout/layout_horizontal_gaps.riv index a10a936..75def70 100644 --- a/test/assets/layout/layout_horizontal_gaps.riv +++ b/test/assets/layout/layout_horizontal_gaps.riv Binary files differ
diff --git a/test/assets/layout/layout_horizontal_wrap.riv b/test/assets/layout/layout_horizontal_wrap.riv index f851c6b..8ecfdbf 100644 --- a/test/assets/layout/layout_horizontal_wrap.riv +++ b/test/assets/layout/layout_horizontal_wrap.riv Binary files differ
diff --git a/test/assets/layout/layout_vertical.riv b/test/assets/layout/layout_vertical.riv index 35248ab..742e001 100644 --- a/test/assets/layout/layout_vertical.riv +++ b/test/assets/layout/layout_vertical.riv Binary files differ
diff --git a/test/assets/layout/measure_tests.riv b/test/assets/layout/measure_tests.riv index 1f4e5cc..9d8595e 100644 --- a/test/assets/layout/measure_tests.riv +++ b/test/assets/layout/measure_tests.riv Binary files differ