From af5d88e90da4be777e8475dd5eea561de9c2fcb2 Mon Sep 17 00:00:00 2001 From: Luigi Rosso Date: Thu, 5 Aug 2021 17:34:42 -0700 Subject: [PATCH] Adding support for translation, rotation, and scale constraints. --- .../generated/animation/animation_base.dart | 2 +- .../animation/animation_state_base.dart | 2 +- .../animation/blend_animation_1d_base.dart | 2 +- .../animation/blend_animation_base.dart | 2 +- .../blend_animation_direct_base.dart | 2 +- .../animation/blend_state_1d_base.dart | 2 +- .../blend_state_transition_base.dart | 2 +- .../animation/cubic_interpolator_base.dart | 2 +- .../animation/keyed_object_base.dart | 2 +- .../animation/keyed_property_base.dart | 2 +- .../generated/animation/keyframe_base.dart | 2 +- .../animation/keyframe_bool_base.dart | 42 +++ .../animation/keyframe_color_base.dart | 2 +- .../animation/keyframe_double_base.dart | 2 +- .../generated/animation/keyframe_id_base.dart | 2 +- .../animation/linear_animation_base.dart | 2 +- .../animation/state_machine_bool_base.dart | 2 +- .../state_machine_component_base.dart | 2 +- .../animation/state_machine_number_base.dart | 2 +- .../animation/state_transition_base.dart | 2 +- .../animation/transition_condition_base.dart | 2 +- .../transition_number_condition_base.dart | 2 +- .../transition_value_condition_base.dart | 2 +- lib/src/generated/artboard_base.dart | 2 +- lib/src/generated/bones/bone_base.dart | 2 +- .../generated/bones/cubic_weight_base.dart | 2 +- lib/src/generated/bones/root_bone_base.dart | 2 +- lib/src/generated/bones/skin_base.dart | 2 +- lib/src/generated/bones/tendon_base.dart | 2 +- lib/src/generated/bones/weight_base.dart | 2 +- lib/src/generated/component_base.dart | 2 +- .../constraints/constraint_base.dart | 2 +- .../constraints/distance_constraint_base.dart | 2 +- .../constraints/ik_constraint_base.dart | 2 +- .../constraints/rotation_constraint_base.dart | 25 ++ .../constraints/scale_constraint_base.dart | 27 ++ .../constraints/targeted_constraint_base.dart | 2 +- .../transform_component_constraint_base.dart | 231 +++++++++++++++ ...transform_component_constraint_y_base.dart | 182 ++++++++++++ .../transform_constraint_base.dart | 63 +---- .../transform_space_constraint_base.dart | 78 ++++++ .../translation_constraint_base.dart | 27 ++ lib/src/generated/draw_rules_base.dart | 2 +- lib/src/generated/draw_target_base.dart | 2 +- lib/src/generated/drawable_base.dart | 2 +- lib/src/generated/node_base.dart | 2 +- lib/src/generated/rive_core_context.dart | 264 ++++++++++++++++-- .../generated/shapes/clipping_shape_base.dart | 2 +- .../shapes/cubic_asymmetric_vertex_base.dart | 2 +- .../shapes/cubic_detached_vertex_base.dart | 2 +- .../shapes/cubic_mirrored_vertex_base.dart | 2 +- lib/src/generated/shapes/paint/fill_base.dart | 2 +- .../shapes/paint/gradient_stop_base.dart | 2 +- .../shapes/paint/linear_gradient_base.dart | 2 +- .../shapes/paint/shape_paint_base.dart | 2 +- .../shapes/paint/solid_color_base.dart | 2 +- .../generated/shapes/paint/stroke_base.dart | 2 +- .../shapes/paint/trim_path_base.dart | 2 +- .../shapes/parametric_path_base.dart | 2 +- lib/src/generated/shapes/path_base.dart | 2 +- .../generated/shapes/path_vertex_base.dart | 2 +- .../generated/shapes/points_path_base.dart | 2 +- lib/src/generated/shapes/polygon_base.dart | 2 +- lib/src/generated/shapes/rectangle_base.dart | 2 +- lib/src/generated/shapes/star_base.dart | 2 +- .../shapes/straight_vertex_base.dart | 2 +- .../generated/transform_component_base.dart | 2 +- .../rive_core/animation/keyframe_bool.dart | 24 ++ .../rive_core/animation/keyframe_double.dart | 4 - lib/src/rive_core/component_flags.dart | 42 +++ .../constraints/rotation_constraint.dart | 101 +++++++ .../constraints/scale_constraint.dart | 106 +++++++ .../transform_component_constraint.dart | 33 +++ .../transform_component_constraint_y.dart | 23 ++ .../constraints/transform_constraint.dart | 16 -- .../transform_space_constraint.dart | 21 ++ .../constraints/translation_constraint.dart | 93 ++++++ lib/src/rive_core/transform_component.dart | 6 + 78 files changed, 1362 insertions(+), 162 deletions(-) create mode 100644 lib/src/generated/animation/keyframe_bool_base.dart create mode 100644 lib/src/generated/constraints/rotation_constraint_base.dart create mode 100644 lib/src/generated/constraints/scale_constraint_base.dart create mode 100644 lib/src/generated/constraints/transform_component_constraint_base.dart create mode 100644 lib/src/generated/constraints/transform_component_constraint_y_base.dart create mode 100644 lib/src/generated/constraints/transform_space_constraint_base.dart create mode 100644 lib/src/generated/constraints/translation_constraint_base.dart create mode 100644 lib/src/rive_core/animation/keyframe_bool.dart create mode 100644 lib/src/rive_core/constraints/rotation_constraint.dart create mode 100644 lib/src/rive_core/constraints/scale_constraint.dart create mode 100644 lib/src/rive_core/constraints/transform_component_constraint.dart create mode 100644 lib/src/rive_core/constraints/transform_component_constraint_y.dart create mode 100644 lib/src/rive_core/constraints/transform_space_constraint.dart create mode 100644 lib/src/rive_core/constraints/translation_constraint.dart diff --git a/lib/src/generated/animation/animation_base.dart b/lib/src/generated/animation/animation_base.dart index 7ae7609..9244cdb 100644 --- a/lib/src/generated/animation/animation_base.dart +++ b/lib/src/generated/animation/animation_base.dart @@ -36,7 +36,7 @@ abstract class AnimationBase extends Core { void nameChanged(String from, String to); @override - void copy(AnimationBase source) { + void copy(covariant AnimationBase source) { _name = source._name; } } diff --git a/lib/src/generated/animation/animation_state_base.dart b/lib/src/generated/animation/animation_state_base.dart index 37f9f5f..f81bc42 100644 --- a/lib/src/generated/animation/animation_state_base.dart +++ b/lib/src/generated/animation/animation_state_base.dart @@ -43,7 +43,7 @@ abstract class AnimationStateBase extends LayerState { void animationIdChanged(int from, int to); @override - void copy(AnimationStateBase source) { + void copy(covariant AnimationStateBase source) { super.copy(source); _animationId = source._animationId; } diff --git a/lib/src/generated/animation/blend_animation_1d_base.dart b/lib/src/generated/animation/blend_animation_1d_base.dart index a11f281..875e650 100644 --- a/lib/src/generated/animation/blend_animation_1d_base.dart +++ b/lib/src/generated/animation/blend_animation_1d_base.dart @@ -36,7 +36,7 @@ abstract class BlendAnimation1DBase extends BlendAnimation { void valueChanged(double from, double to); @override - void copy(BlendAnimation1DBase source) { + void copy(covariant BlendAnimation1DBase source) { super.copy(source); _value = source._value; } diff --git a/lib/src/generated/animation/blend_animation_base.dart b/lib/src/generated/animation/blend_animation_base.dart index 71920a2..3d4885e 100644 --- a/lib/src/generated/animation/blend_animation_base.dart +++ b/lib/src/generated/animation/blend_animation_base.dart @@ -37,7 +37,7 @@ abstract class BlendAnimationBase extends Core { void animationIdChanged(int from, int to); @override - void copy(BlendAnimationBase source) { + void copy(covariant BlendAnimationBase source) { _animationId = source._animationId; } } diff --git a/lib/src/generated/animation/blend_animation_direct_base.dart b/lib/src/generated/animation/blend_animation_direct_base.dart index 2272bce..d722451 100644 --- a/lib/src/generated/animation/blend_animation_direct_base.dart +++ b/lib/src/generated/animation/blend_animation_direct_base.dart @@ -38,7 +38,7 @@ abstract class BlendAnimationDirectBase extends BlendAnimation { void inputIdChanged(int from, int to); @override - void copy(BlendAnimationDirectBase source) { + void copy(covariant BlendAnimationDirectBase source) { super.copy(source); _inputId = source._inputId; } diff --git a/lib/src/generated/animation/blend_state_1d_base.dart b/lib/src/generated/animation/blend_state_1d_base.dart index efd14a9..7cf9fc1 100644 --- a/lib/src/generated/animation/blend_state_1d_base.dart +++ b/lib/src/generated/animation/blend_state_1d_base.dart @@ -45,7 +45,7 @@ abstract class BlendState1DBase extends BlendState { void inputIdChanged(int from, int to); @override - void copy(BlendState1DBase source) { + void copy(covariant BlendState1DBase source) { super.copy(source); _inputId = source._inputId; } diff --git a/lib/src/generated/animation/blend_state_transition_base.dart b/lib/src/generated/animation/blend_state_transition_base.dart index d9879e3..7330f48 100644 --- a/lib/src/generated/animation/blend_state_transition_base.dart +++ b/lib/src/generated/animation/blend_state_transition_base.dart @@ -43,7 +43,7 @@ abstract class BlendStateTransitionBase extends StateTransition { void exitBlendAnimationIdChanged(int from, int to); @override - void copy(BlendStateTransitionBase source) { + void copy(covariant BlendStateTransitionBase source) { super.copy(source); _exitBlendAnimationId = source._exitBlendAnimationId; } diff --git a/lib/src/generated/animation/cubic_interpolator_base.dart b/lib/src/generated/animation/cubic_interpolator_base.dart index d580991..ead545a 100644 --- a/lib/src/generated/animation/cubic_interpolator_base.dart +++ b/lib/src/generated/animation/cubic_interpolator_base.dart @@ -100,7 +100,7 @@ abstract class CubicInterpolatorBase extends Core { void y2Changed(double from, double to); @override - void copy(CubicInterpolatorBase source) { + void copy(covariant CubicInterpolatorBase source) { _x1 = source._x1; _y1 = source._y1; _x2 = source._x2; diff --git a/lib/src/generated/animation/keyed_object_base.dart b/lib/src/generated/animation/keyed_object_base.dart index a232de2..bf2c28b 100644 --- a/lib/src/generated/animation/keyed_object_base.dart +++ b/lib/src/generated/animation/keyed_object_base.dart @@ -36,7 +36,7 @@ abstract class KeyedObjectBase extends Core { void objectIdChanged(int from, int to); @override - void copy(KeyedObjectBase source) { + void copy(covariant KeyedObjectBase source) { _objectId = source._objectId; } } diff --git a/lib/src/generated/animation/keyed_property_base.dart b/lib/src/generated/animation/keyed_property_base.dart index 8b73216..0855a26 100644 --- a/lib/src/generated/animation/keyed_property_base.dart +++ b/lib/src/generated/animation/keyed_property_base.dart @@ -37,7 +37,7 @@ abstract class KeyedPropertyBase extends Core { void propertyKeyChanged(int from, int to); @override - void copy(KeyedPropertyBase source) { + void copy(covariant KeyedPropertyBase source) { _propertyKey = source._propertyKey; } } diff --git a/lib/src/generated/animation/keyframe_base.dart b/lib/src/generated/animation/keyframe_base.dart index de547b5..abc8601 100644 --- a/lib/src/generated/animation/keyframe_base.dart +++ b/lib/src/generated/animation/keyframe_base.dart @@ -87,7 +87,7 @@ abstract class KeyFrameBase extends Core { void interpolatorIdChanged(int from, int to); @override - void copy(KeyFrameBase source) { + void copy(covariant KeyFrameBase source) { _frame = source._frame; _interpolationType = source._interpolationType; _interpolatorId = source._interpolatorId; diff --git a/lib/src/generated/animation/keyframe_bool_base.dart b/lib/src/generated/animation/keyframe_bool_base.dart new file mode 100644 index 0000000..58431ce --- /dev/null +++ b/lib/src/generated/animation/keyframe_bool_base.dart @@ -0,0 +1,42 @@ +/// Core automatically generated +/// lib/src/generated/animation/keyframe_bool_base.dart. +/// Do not modify manually. + +import 'package:rive/src/generated/animation/keyframe_base.dart'; +import 'package:rive/src/rive_core/animation/keyframe.dart'; + +abstract class KeyFrameBoolBase extends KeyFrame { + static const int typeKey = 84; + @override + int get coreType => KeyFrameBoolBase.typeKey; + @override + Set get coreTypes => {KeyFrameBoolBase.typeKey, KeyFrameBase.typeKey}; + + /// -------------------------------------------------------------------------- + /// Value field with key 181. + static const bool valueInitialValue = false; + bool _value = valueInitialValue; + static const int valuePropertyKey = 181; + bool get value => _value; + + /// Change the [_value] field value. + /// [valueChanged] will be invoked only if the field's value has changed. + set value(bool value) { + if (_value == value) { + return; + } + bool from = _value; + _value = value; + if (hasValidated) { + valueChanged(from, value); + } + } + + void valueChanged(bool from, bool to); + + @override + void copy(covariant KeyFrameBoolBase source) { + super.copy(source); + _value = source._value; + } +} diff --git a/lib/src/generated/animation/keyframe_color_base.dart b/lib/src/generated/animation/keyframe_color_base.dart index dd250c1..66949ed 100644 --- a/lib/src/generated/animation/keyframe_color_base.dart +++ b/lib/src/generated/animation/keyframe_color_base.dart @@ -35,7 +35,7 @@ abstract class KeyFrameColorBase extends KeyFrame { void valueChanged(int from, int to); @override - void copy(KeyFrameColorBase source) { + void copy(covariant KeyFrameColorBase source) { super.copy(source); _value = source._value; } diff --git a/lib/src/generated/animation/keyframe_double_base.dart b/lib/src/generated/animation/keyframe_double_base.dart index e369bbf..a45c0dd 100644 --- a/lib/src/generated/animation/keyframe_double_base.dart +++ b/lib/src/generated/animation/keyframe_double_base.dart @@ -35,7 +35,7 @@ abstract class KeyFrameDoubleBase extends KeyFrame { void valueChanged(double from, double to); @override - void copy(KeyFrameDoubleBase source) { + void copy(covariant KeyFrameDoubleBase source) { super.copy(source); _value = source._value; } diff --git a/lib/src/generated/animation/keyframe_id_base.dart b/lib/src/generated/animation/keyframe_id_base.dart index 968da47..9157fa3 100644 --- a/lib/src/generated/animation/keyframe_id_base.dart +++ b/lib/src/generated/animation/keyframe_id_base.dart @@ -35,7 +35,7 @@ abstract class KeyFrameIdBase extends KeyFrame { void valueChanged(int from, int to); @override - void copy(KeyFrameIdBase source) { + void copy(covariant KeyFrameIdBase source) { super.copy(source); _value = source._value; } diff --git a/lib/src/generated/animation/linear_animation_base.dart b/lib/src/generated/animation/linear_animation_base.dart index 6cfd53a..2e50da3 100644 --- a/lib/src/generated/animation/linear_animation_base.dart +++ b/lib/src/generated/animation/linear_animation_base.dart @@ -184,7 +184,7 @@ abstract class LinearAnimationBase extends Animation { void enableWorkAreaChanged(bool from, bool to); @override - void copy(LinearAnimationBase source) { + void copy(covariant LinearAnimationBase source) { super.copy(source); _fps = source._fps; _duration = source._duration; diff --git a/lib/src/generated/animation/state_machine_bool_base.dart b/lib/src/generated/animation/state_machine_bool_base.dart index 4a0e216..ff57bfa 100644 --- a/lib/src/generated/animation/state_machine_bool_base.dart +++ b/lib/src/generated/animation/state_machine_bool_base.dart @@ -40,7 +40,7 @@ abstract class StateMachineBoolBase extends StateMachineInput { void valueChanged(bool from, bool to); @override - void copy(StateMachineBoolBase source) { + void copy(covariant StateMachineBoolBase source) { super.copy(source); _value = source._value; } diff --git a/lib/src/generated/animation/state_machine_component_base.dart b/lib/src/generated/animation/state_machine_component_base.dart index 9d0ff22..ab17351 100644 --- a/lib/src/generated/animation/state_machine_component_base.dart +++ b/lib/src/generated/animation/state_machine_component_base.dart @@ -38,7 +38,7 @@ abstract class StateMachineComponentBase void nameChanged(String from, String to); @override - void copy(StateMachineComponentBase source) { + void copy(covariant StateMachineComponentBase source) { _name = source._name; } } diff --git a/lib/src/generated/animation/state_machine_number_base.dart b/lib/src/generated/animation/state_machine_number_base.dart index e7b894c..b59584c 100644 --- a/lib/src/generated/animation/state_machine_number_base.dart +++ b/lib/src/generated/animation/state_machine_number_base.dart @@ -40,7 +40,7 @@ abstract class StateMachineNumberBase extends StateMachineInput { void valueChanged(double from, double to); @override - void copy(StateMachineNumberBase source) { + void copy(covariant StateMachineNumberBase source) { super.copy(source); _value = source._value; } diff --git a/lib/src/generated/animation/state_transition_base.dart b/lib/src/generated/animation/state_transition_base.dart index 23c71b2..41f474b 100644 --- a/lib/src/generated/animation/state_transition_base.dart +++ b/lib/src/generated/animation/state_transition_base.dart @@ -111,7 +111,7 @@ abstract class StateTransitionBase extends StateMachineLayerComponent { void exitTimeChanged(int from, int to); @override - void copy(StateTransitionBase source) { + void copy(covariant StateTransitionBase source) { super.copy(source); _stateToId = source._stateToId; _flags = source._flags; diff --git a/lib/src/generated/animation/transition_condition_base.dart b/lib/src/generated/animation/transition_condition_base.dart index 352cffd..7dbeffc 100644 --- a/lib/src/generated/animation/transition_condition_base.dart +++ b/lib/src/generated/animation/transition_condition_base.dart @@ -36,7 +36,7 @@ abstract class TransitionConditionBase extends Core { void inputIdChanged(int from, int to); @override - void copy(TransitionConditionBase source) { + void copy(covariant TransitionConditionBase source) { _inputId = source._inputId; } } diff --git a/lib/src/generated/animation/transition_number_condition_base.dart b/lib/src/generated/animation/transition_number_condition_base.dart index bf0075f..6b4b570 100644 --- a/lib/src/generated/animation/transition_number_condition_base.dart +++ b/lib/src/generated/animation/transition_number_condition_base.dart @@ -40,7 +40,7 @@ abstract class TransitionNumberConditionBase extends TransitionValueCondition { void valueChanged(double from, double to); @override - void copy(TransitionNumberConditionBase source) { + void copy(covariant TransitionNumberConditionBase source) { super.copy(source); _value = source._value; } diff --git a/lib/src/generated/animation/transition_value_condition_base.dart b/lib/src/generated/animation/transition_value_condition_base.dart index a111917..46021ed 100644 --- a/lib/src/generated/animation/transition_value_condition_base.dart +++ b/lib/src/generated/animation/transition_value_condition_base.dart @@ -38,7 +38,7 @@ abstract class TransitionValueConditionBase extends TransitionCondition { void opValueChanged(int from, int to); @override - void copy(TransitionValueConditionBase source) { + void copy(covariant TransitionValueConditionBase source) { super.copy(source); _opValue = source._opValue; } diff --git a/lib/src/generated/artboard_base.dart b/lib/src/generated/artboard_base.dart index aafa511..e039794 100644 --- a/lib/src/generated/artboard_base.dart +++ b/lib/src/generated/artboard_base.dart @@ -161,7 +161,7 @@ abstract class ArtboardBase extends ContainerComponent { void originYChanged(double from, double to); @override - void copy(ArtboardBase source) { + void copy(covariant ArtboardBase source) { super.copy(source); _width = source._width; _height = source._height; diff --git a/lib/src/generated/bones/bone_base.dart b/lib/src/generated/bones/bone_base.dart index a7dca13..4b28e88 100644 --- a/lib/src/generated/bones/bone_base.dart +++ b/lib/src/generated/bones/bone_base.dart @@ -43,7 +43,7 @@ abstract class BoneBase extends SkeletalComponent { void lengthChanged(double from, double to); @override - void copy(BoneBase source) { + void copy(covariant BoneBase source) { super.copy(source); _length = source._length; } diff --git a/lib/src/generated/bones/cubic_weight_base.dart b/lib/src/generated/bones/cubic_weight_base.dart index feeaf93..281e964 100644 --- a/lib/src/generated/bones/cubic_weight_base.dart +++ b/lib/src/generated/bones/cubic_weight_base.dart @@ -102,7 +102,7 @@ abstract class CubicWeightBase extends Weight { void outIndicesChanged(int from, int to); @override - void copy(CubicWeightBase source) { + void copy(covariant CubicWeightBase source) { super.copy(source); _inValues = source._inValues; _inIndices = source._inIndices; diff --git a/lib/src/generated/bones/root_bone_base.dart b/lib/src/generated/bones/root_bone_base.dart index b61b651..933a9b9 100644 --- a/lib/src/generated/bones/root_bone_base.dart +++ b/lib/src/generated/bones/root_bone_base.dart @@ -71,7 +71,7 @@ abstract class RootBoneBase extends Bone { void yChanged(double from, double to); @override - void copy(RootBoneBase source) { + void copy(covariant RootBoneBase source) { super.copy(source); _x = source._x; _y = source._y; diff --git a/lib/src/generated/bones/skin_base.dart b/lib/src/generated/bones/skin_base.dart index 1765610..509c97d 100644 --- a/lib/src/generated/bones/skin_base.dart +++ b/lib/src/generated/bones/skin_base.dart @@ -158,7 +158,7 @@ abstract class SkinBase extends ContainerComponent { void tyChanged(double from, double to); @override - void copy(SkinBase source) { + void copy(covariant SkinBase source) { super.copy(source); _xx = source._xx; _yx = source._yx; diff --git a/lib/src/generated/bones/tendon_base.dart b/lib/src/generated/bones/tendon_base.dart index f58050c..ec54578 100644 --- a/lib/src/generated/bones/tendon_base.dart +++ b/lib/src/generated/bones/tendon_base.dart @@ -180,7 +180,7 @@ abstract class TendonBase extends Component { void tyChanged(double from, double to); @override - void copy(TendonBase source) { + void copy(covariant TendonBase source) { super.copy(source); _boneId = source._boneId; _xx = source._xx; diff --git a/lib/src/generated/bones/weight_base.dart b/lib/src/generated/bones/weight_base.dart index 87c4aa8..4e04af6 100644 --- a/lib/src/generated/bones/weight_base.dart +++ b/lib/src/generated/bones/weight_base.dart @@ -56,7 +56,7 @@ abstract class WeightBase extends Component { void indicesChanged(int from, int to); @override - void copy(WeightBase source) { + void copy(covariant WeightBase source) { super.copy(source); _values = source._values; _indices = source._indices; diff --git a/lib/src/generated/component_base.dart b/lib/src/generated/component_base.dart index 378c108..1b30c19 100644 --- a/lib/src/generated/component_base.dart +++ b/lib/src/generated/component_base.dart @@ -60,7 +60,7 @@ abstract class ComponentBase extends Core { void parentIdChanged(int from, int to); @override - void copy(ComponentBase source) { + void copy(covariant ComponentBase source) { _name = source._name; _parentId = source._parentId; } diff --git a/lib/src/generated/constraints/constraint_base.dart b/lib/src/generated/constraints/constraint_base.dart index bec92f1..e6fe4ea 100644 --- a/lib/src/generated/constraints/constraint_base.dart +++ b/lib/src/generated/constraints/constraint_base.dart @@ -37,7 +37,7 @@ abstract class ConstraintBase extends Component { void strengthChanged(double from, double to); @override - void copy(ConstraintBase source) { + void copy(covariant ConstraintBase source) { super.copy(source); _strength = source._strength; } diff --git a/lib/src/generated/constraints/distance_constraint_base.dart b/lib/src/generated/constraints/distance_constraint_base.dart index 8aba167..32ca075 100644 --- a/lib/src/generated/constraints/distance_constraint_base.dart +++ b/lib/src/generated/constraints/distance_constraint_base.dart @@ -69,7 +69,7 @@ abstract class DistanceConstraintBase extends TargetedConstraint { void modeValueChanged(int from, int to); @override - void copy(DistanceConstraintBase source) { + void copy(covariant DistanceConstraintBase source) { super.copy(source); _distance = source._distance; _modeValue = source._modeValue; diff --git a/lib/src/generated/constraints/ik_constraint_base.dart b/lib/src/generated/constraints/ik_constraint_base.dart index bbe7192..9e74cae 100644 --- a/lib/src/generated/constraints/ik_constraint_base.dart +++ b/lib/src/generated/constraints/ik_constraint_base.dart @@ -72,7 +72,7 @@ abstract class IKConstraintBase extends TargetedConstraint { void parentBoneCountChanged(int from, int to); @override - void copy(IKConstraintBase source) { + void copy(covariant IKConstraintBase source) { super.copy(source); _invertDirection = source._invertDirection; _parentBoneCount = source._parentBoneCount; diff --git a/lib/src/generated/constraints/rotation_constraint_base.dart b/lib/src/generated/constraints/rotation_constraint_base.dart new file mode 100644 index 0000000..07d4384 --- /dev/null +++ b/lib/src/generated/constraints/rotation_constraint_base.dart @@ -0,0 +1,25 @@ +/// Core automatically generated +/// lib/src/generated/constraints/rotation_constraint_base.dart. +/// Do not modify manually. + +import 'package:rive/src/generated/component_base.dart'; +import 'package:rive/src/generated/constraints/constraint_base.dart'; +import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/rive_core/constraints/transform_component_constraint.dart'; + +abstract class RotationConstraintBase extends TransformComponentConstraint { + static const int typeKey = 89; + @override + int get coreType => RotationConstraintBase.typeKey; + @override + Set get coreTypes => { + RotationConstraintBase.typeKey, + TransformComponentConstraintBase.typeKey, + TransformSpaceConstraintBase.typeKey, + TargetedConstraintBase.typeKey, + ConstraintBase.typeKey, + ComponentBase.typeKey + }; +} diff --git a/lib/src/generated/constraints/scale_constraint_base.dart b/lib/src/generated/constraints/scale_constraint_base.dart new file mode 100644 index 0000000..04cf23d --- /dev/null +++ b/lib/src/generated/constraints/scale_constraint_base.dart @@ -0,0 +1,27 @@ +/// Core automatically generated +/// lib/src/generated/constraints/scale_constraint_base.dart. +/// Do not modify manually. + +import 'package:rive/src/generated/component_base.dart'; +import 'package:rive/src/generated/constraints/constraint_base.dart'; +import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_y_base.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/rive_core/constraints/transform_component_constraint_y.dart'; + +abstract class ScaleConstraintBase extends TransformComponentConstraintY { + static const int typeKey = 88; + @override + int get coreType => ScaleConstraintBase.typeKey; + @override + Set get coreTypes => { + ScaleConstraintBase.typeKey, + TransformComponentConstraintYBase.typeKey, + TransformComponentConstraintBase.typeKey, + TransformSpaceConstraintBase.typeKey, + TargetedConstraintBase.typeKey, + ConstraintBase.typeKey, + ComponentBase.typeKey + }; +} diff --git a/lib/src/generated/constraints/targeted_constraint_base.dart b/lib/src/generated/constraints/targeted_constraint_base.dart index e976c2c..7b74302 100644 --- a/lib/src/generated/constraints/targeted_constraint_base.dart +++ b/lib/src/generated/constraints/targeted_constraint_base.dart @@ -43,7 +43,7 @@ abstract class TargetedConstraintBase extends Constraint { void targetIdChanged(int from, int to); @override - void copy(TargetedConstraintBase source) { + void copy(covariant TargetedConstraintBase source) { super.copy(source); _targetId = source._targetId; } diff --git a/lib/src/generated/constraints/transform_component_constraint_base.dart b/lib/src/generated/constraints/transform_component_constraint_base.dart new file mode 100644 index 0000000..a4fdf27 --- /dev/null +++ b/lib/src/generated/constraints/transform_component_constraint_base.dart @@ -0,0 +1,231 @@ +/// Core automatically generated +/// lib/src/generated/constraints/transform_component_constraint_base.dart. +/// Do not modify manually. + +import 'package:rive/src/generated/component_base.dart'; +import 'package:rive/src/generated/constraints/constraint_base.dart'; +import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/rive_core/constraints/transform_space_constraint.dart'; + +abstract class TransformComponentConstraintBase + extends TransformSpaceConstraint { + static const int typeKey = 85; + @override + int get coreType => TransformComponentConstraintBase.typeKey; + @override + Set get coreTypes => { + TransformComponentConstraintBase.typeKey, + TransformSpaceConstraintBase.typeKey, + TargetedConstraintBase.typeKey, + ConstraintBase.typeKey, + ComponentBase.typeKey + }; + + /// -------------------------------------------------------------------------- + /// MinMaxSpaceValue field with key 195. + static const int minMaxSpaceValueInitialValue = 0; + int _minMaxSpaceValue = minMaxSpaceValueInitialValue; + static const int minMaxSpaceValuePropertyKey = 195; + + /// The min/max transform space. + int get minMaxSpaceValue => _minMaxSpaceValue; + + /// Change the [_minMaxSpaceValue] field value. + /// [minMaxSpaceValueChanged] will be invoked only if the field's value has + /// changed. + set minMaxSpaceValue(int value) { + if (_minMaxSpaceValue == value) { + return; + } + int from = _minMaxSpaceValue; + _minMaxSpaceValue = value; + if (hasValidated) { + minMaxSpaceValueChanged(from, value); + } + } + + void minMaxSpaceValueChanged(int from, int to); + + /// -------------------------------------------------------------------------- + /// CopyFactor field with key 182. + static const double copyFactorInitialValue = 1; + double _copyFactor = copyFactorInitialValue; + static const int copyFactorPropertyKey = 182; + + /// Copy factor. + double get copyFactor => _copyFactor; + + /// Change the [_copyFactor] field value. + /// [copyFactorChanged] will be invoked only if the field's value has changed. + set copyFactor(double value) { + if (_copyFactor == value) { + return; + } + double from = _copyFactor; + _copyFactor = value; + if (hasValidated) { + copyFactorChanged(from, value); + } + } + + void copyFactorChanged(double from, double to); + + /// -------------------------------------------------------------------------- + /// MinValue field with key 183. + static const double minValueInitialValue = 0; + double _minValue = minValueInitialValue; + static const int minValuePropertyKey = 183; + + /// Minimum value. + double get minValue => _minValue; + + /// Change the [_minValue] field value. + /// [minValueChanged] will be invoked only if the field's value has changed. + set minValue(double value) { + if (_minValue == value) { + return; + } + double from = _minValue; + _minValue = value; + if (hasValidated) { + minValueChanged(from, value); + } + } + + void minValueChanged(double from, double to); + + /// -------------------------------------------------------------------------- + /// MaxValue field with key 184. + static const double maxValueInitialValue = 0; + double _maxValue = maxValueInitialValue; + static const int maxValuePropertyKey = 184; + + /// Maximum value. + double get maxValue => _maxValue; + + /// Change the [_maxValue] field value. + /// [maxValueChanged] will be invoked only if the field's value has changed. + set maxValue(double value) { + if (_maxValue == value) { + return; + } + double from = _maxValue; + _maxValue = value; + if (hasValidated) { + maxValueChanged(from, value); + } + } + + void maxValueChanged(double from, double to); + + /// -------------------------------------------------------------------------- + /// Offset field with key 188. + static const bool offsetInitialValue = false; + bool _offset = offsetInitialValue; + static const int offsetPropertyKey = 188; + + /// True when the original component (rotation/scale/translation) is used to + /// offset the copied one. + bool get offset => _offset; + + /// Change the [_offset] field value. + /// [offsetChanged] will be invoked only if the field's value has changed. + set offset(bool value) { + if (_offset == value) { + return; + } + bool from = _offset; + _offset = value; + if (hasValidated) { + offsetChanged(from, value); + } + } + + void offsetChanged(bool from, bool to); + + /// -------------------------------------------------------------------------- + /// DoesCopy field with key 189. + static const bool doesCopyInitialValue = true; + bool _doesCopy = doesCopyInitialValue; + static const int doesCopyPropertyKey = 189; + + /// Whether the component is copied. + bool get doesCopy => _doesCopy; + + /// Change the [_doesCopy] field value. + /// [doesCopyChanged] will be invoked only if the field's value has changed. + set doesCopy(bool value) { + if (_doesCopy == value) { + return; + } + bool from = _doesCopy; + _doesCopy = value; + if (hasValidated) { + doesCopyChanged(from, value); + } + } + + void doesCopyChanged(bool from, bool to); + + /// -------------------------------------------------------------------------- + /// Min field with key 190. + static const bool minInitialValue = false; + bool _min = minInitialValue; + static const int minPropertyKey = 190; + + /// Whether min is used. + bool get min => _min; + + /// Change the [_min] field value. + /// [minChanged] will be invoked only if the field's value has changed. + set min(bool value) { + if (_min == value) { + return; + } + bool from = _min; + _min = value; + if (hasValidated) { + minChanged(from, value); + } + } + + void minChanged(bool from, bool to); + + /// -------------------------------------------------------------------------- + /// Max field with key 191. + static const bool maxInitialValue = false; + bool _max = maxInitialValue; + static const int maxPropertyKey = 191; + + /// Whether max is used. + bool get max => _max; + + /// Change the [_max] field value. + /// [maxChanged] will be invoked only if the field's value has changed. + set max(bool value) { + if (_max == value) { + return; + } + bool from = _max; + _max = value; + if (hasValidated) { + maxChanged(from, value); + } + } + + void maxChanged(bool from, bool to); + + @override + void copy(covariant TransformComponentConstraintBase source) { + super.copy(source); + _minMaxSpaceValue = source._minMaxSpaceValue; + _copyFactor = source._copyFactor; + _minValue = source._minValue; + _maxValue = source._maxValue; + _offset = source._offset; + _doesCopy = source._doesCopy; + _min = source._min; + _max = source._max; + } +} diff --git a/lib/src/generated/constraints/transform_component_constraint_y_base.dart b/lib/src/generated/constraints/transform_component_constraint_y_base.dart new file mode 100644 index 0000000..72629b8 --- /dev/null +++ b/lib/src/generated/constraints/transform_component_constraint_y_base.dart @@ -0,0 +1,182 @@ +/// Core automatically generated +/// lib/src/generated/constraints/transform_component_constraint_y_base.dart. +/// Do not modify manually. + +import 'package:rive/src/generated/component_base.dart'; +import 'package:rive/src/generated/constraints/constraint_base.dart'; +import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/rive_core/constraints/transform_component_constraint.dart'; + +abstract class TransformComponentConstraintYBase + extends TransformComponentConstraint { + static const int typeKey = 86; + @override + int get coreType => TransformComponentConstraintYBase.typeKey; + @override + Set get coreTypes => { + TransformComponentConstraintYBase.typeKey, + TransformComponentConstraintBase.typeKey, + TransformSpaceConstraintBase.typeKey, + TargetedConstraintBase.typeKey, + ConstraintBase.typeKey, + ComponentBase.typeKey + }; + + /// -------------------------------------------------------------------------- + /// CopyFactorY field with key 185. + static const double copyFactorYInitialValue = 1; + double _copyFactorY = copyFactorYInitialValue; + static const int copyFactorYPropertyKey = 185; + + /// Copy factor. + double get copyFactorY => _copyFactorY; + + /// Change the [_copyFactorY] field value. + /// [copyFactorYChanged] will be invoked only if the field's value has + /// changed. + set copyFactorY(double value) { + if (_copyFactorY == value) { + return; + } + double from = _copyFactorY; + _copyFactorY = value; + if (hasValidated) { + copyFactorYChanged(from, value); + } + } + + void copyFactorYChanged(double from, double to); + + /// -------------------------------------------------------------------------- + /// MinValueY field with key 186. + static const double minValueYInitialValue = 0; + double _minValueY = minValueYInitialValue; + static const int minValueYPropertyKey = 186; + + /// Minimum value. + double get minValueY => _minValueY; + + /// Change the [_minValueY] field value. + /// [minValueYChanged] will be invoked only if the field's value has changed. + set minValueY(double value) { + if (_minValueY == value) { + return; + } + double from = _minValueY; + _minValueY = value; + if (hasValidated) { + minValueYChanged(from, value); + } + } + + void minValueYChanged(double from, double to); + + /// -------------------------------------------------------------------------- + /// MaxValueY field with key 187. + static const double maxValueYInitialValue = 0; + double _maxValueY = maxValueYInitialValue; + static const int maxValueYPropertyKey = 187; + + /// Maximum value. + double get maxValueY => _maxValueY; + + /// Change the [_maxValueY] field value. + /// [maxValueYChanged] will be invoked only if the field's value has changed. + set maxValueY(double value) { + if (_maxValueY == value) { + return; + } + double from = _maxValueY; + _maxValueY = value; + if (hasValidated) { + maxValueYChanged(from, value); + } + } + + void maxValueYChanged(double from, double to); + + /// -------------------------------------------------------------------------- + /// DoesCopyY field with key 192. + static const bool doesCopyYInitialValue = true; + bool _doesCopyY = doesCopyYInitialValue; + static const int doesCopyYPropertyKey = 192; + + /// Whether the Y component is copied. + bool get doesCopyY => _doesCopyY; + + /// Change the [_doesCopyY] field value. + /// [doesCopyYChanged] will be invoked only if the field's value has changed. + set doesCopyY(bool value) { + if (_doesCopyY == value) { + return; + } + bool from = _doesCopyY; + _doesCopyY = value; + if (hasValidated) { + doesCopyYChanged(from, value); + } + } + + void doesCopyYChanged(bool from, bool to); + + /// -------------------------------------------------------------------------- + /// MinY field with key 193. + static const bool minYInitialValue = false; + bool _minY = minYInitialValue; + static const int minYPropertyKey = 193; + + /// Whether min Y is used. + bool get minY => _minY; + + /// Change the [_minY] field value. + /// [minYChanged] will be invoked only if the field's value has changed. + set minY(bool value) { + if (_minY == value) { + return; + } + bool from = _minY; + _minY = value; + if (hasValidated) { + minYChanged(from, value); + } + } + + void minYChanged(bool from, bool to); + + /// -------------------------------------------------------------------------- + /// MaxY field with key 194. + static const bool maxYInitialValue = false; + bool _maxY = maxYInitialValue; + static const int maxYPropertyKey = 194; + + /// Whether max Y is used. + bool get maxY => _maxY; + + /// Change the [_maxY] field value. + /// [maxYChanged] will be invoked only if the field's value has changed. + set maxY(bool value) { + if (_maxY == value) { + return; + } + bool from = _maxY; + _maxY = value; + if (hasValidated) { + maxYChanged(from, value); + } + } + + void maxYChanged(bool from, bool to); + + @override + void copy(covariant TransformComponentConstraintYBase source) { + super.copy(source); + _copyFactorY = source._copyFactorY; + _minValueY = source._minValueY; + _maxValueY = source._maxValueY; + _doesCopyY = source._doesCopyY; + _minY = source._minY; + _maxY = source._maxY; + } +} diff --git a/lib/src/generated/constraints/transform_constraint_base.dart b/lib/src/generated/constraints/transform_constraint_base.dart index e7b0fea..c7ff9d4 100644 --- a/lib/src/generated/constraints/transform_constraint_base.dart +++ b/lib/src/generated/constraints/transform_constraint_base.dart @@ -5,74 +5,19 @@ import 'package:rive/src/generated/component_base.dart'; import 'package:rive/src/generated/constraints/constraint_base.dart'; import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; -import 'package:rive/src/rive_core/constraints/targeted_constraint.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/rive_core/constraints/transform_space_constraint.dart'; -abstract class TransformConstraintBase extends TargetedConstraint { +abstract class TransformConstraintBase extends TransformSpaceConstraint { static const int typeKey = 83; @override int get coreType => TransformConstraintBase.typeKey; @override Set get coreTypes => { TransformConstraintBase.typeKey, + TransformSpaceConstraintBase.typeKey, TargetedConstraintBase.typeKey, ConstraintBase.typeKey, ComponentBase.typeKey }; - - /// -------------------------------------------------------------------------- - /// SourceSpaceValue field with key 179. - static const int sourceSpaceValueInitialValue = 0; - int _sourceSpaceValue = sourceSpaceValueInitialValue; - static const int sourceSpaceValuePropertyKey = 179; - - /// The source transform space. - int get sourceSpaceValue => _sourceSpaceValue; - - /// Change the [_sourceSpaceValue] field value. - /// [sourceSpaceValueChanged] will be invoked only if the field's value has - /// changed. - set sourceSpaceValue(int value) { - if (_sourceSpaceValue == value) { - return; - } - int from = _sourceSpaceValue; - _sourceSpaceValue = value; - if (hasValidated) { - sourceSpaceValueChanged(from, value); - } - } - - void sourceSpaceValueChanged(int from, int to); - - /// -------------------------------------------------------------------------- - /// DestSpaceValue field with key 180. - static const int destSpaceValueInitialValue = 0; - int _destSpaceValue = destSpaceValueInitialValue; - static const int destSpaceValuePropertyKey = 180; - - /// The destination transform space. - int get destSpaceValue => _destSpaceValue; - - /// Change the [_destSpaceValue] field value. - /// [destSpaceValueChanged] will be invoked only if the field's value has - /// changed. - set destSpaceValue(int value) { - if (_destSpaceValue == value) { - return; - } - int from = _destSpaceValue; - _destSpaceValue = value; - if (hasValidated) { - destSpaceValueChanged(from, value); - } - } - - void destSpaceValueChanged(int from, int to); - - @override - void copy(TransformConstraintBase source) { - super.copy(source); - _sourceSpaceValue = source._sourceSpaceValue; - _destSpaceValue = source._destSpaceValue; - } } diff --git a/lib/src/generated/constraints/transform_space_constraint_base.dart b/lib/src/generated/constraints/transform_space_constraint_base.dart new file mode 100644 index 0000000..32667e1 --- /dev/null +++ b/lib/src/generated/constraints/transform_space_constraint_base.dart @@ -0,0 +1,78 @@ +/// Core automatically generated +/// lib/src/generated/constraints/transform_space_constraint_base.dart. +/// Do not modify manually. + +import 'package:rive/src/generated/component_base.dart'; +import 'package:rive/src/generated/constraints/constraint_base.dart'; +import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; +import 'package:rive/src/rive_core/constraints/targeted_constraint.dart'; + +abstract class TransformSpaceConstraintBase extends TargetedConstraint { + static const int typeKey = 90; + @override + int get coreType => TransformSpaceConstraintBase.typeKey; + @override + Set get coreTypes => { + TransformSpaceConstraintBase.typeKey, + TargetedConstraintBase.typeKey, + ConstraintBase.typeKey, + ComponentBase.typeKey + }; + + /// -------------------------------------------------------------------------- + /// SourceSpaceValue field with key 179. + static const int sourceSpaceValueInitialValue = 0; + int _sourceSpaceValue = sourceSpaceValueInitialValue; + static const int sourceSpaceValuePropertyKey = 179; + + /// The source transform space. + int get sourceSpaceValue => _sourceSpaceValue; + + /// Change the [_sourceSpaceValue] field value. + /// [sourceSpaceValueChanged] will be invoked only if the field's value has + /// changed. + set sourceSpaceValue(int value) { + if (_sourceSpaceValue == value) { + return; + } + int from = _sourceSpaceValue; + _sourceSpaceValue = value; + if (hasValidated) { + sourceSpaceValueChanged(from, value); + } + } + + void sourceSpaceValueChanged(int from, int to); + + /// -------------------------------------------------------------------------- + /// DestSpaceValue field with key 180. + static const int destSpaceValueInitialValue = 0; + int _destSpaceValue = destSpaceValueInitialValue; + static const int destSpaceValuePropertyKey = 180; + + /// The destination transform space. + int get destSpaceValue => _destSpaceValue; + + /// Change the [_destSpaceValue] field value. + /// [destSpaceValueChanged] will be invoked only if the field's value has + /// changed. + set destSpaceValue(int value) { + if (_destSpaceValue == value) { + return; + } + int from = _destSpaceValue; + _destSpaceValue = value; + if (hasValidated) { + destSpaceValueChanged(from, value); + } + } + + void destSpaceValueChanged(int from, int to); + + @override + void copy(covariant TransformSpaceConstraintBase source) { + super.copy(source); + _sourceSpaceValue = source._sourceSpaceValue; + _destSpaceValue = source._destSpaceValue; + } +} diff --git a/lib/src/generated/constraints/translation_constraint_base.dart b/lib/src/generated/constraints/translation_constraint_base.dart new file mode 100644 index 0000000..ecd7cf5 --- /dev/null +++ b/lib/src/generated/constraints/translation_constraint_base.dart @@ -0,0 +1,27 @@ +/// Core automatically generated +/// lib/src/generated/constraints/translation_constraint_base.dart. +/// Do not modify manually. + +import 'package:rive/src/generated/component_base.dart'; +import 'package:rive/src/generated/constraints/constraint_base.dart'; +import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_y_base.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/rive_core/constraints/transform_component_constraint_y.dart'; + +abstract class TranslationConstraintBase extends TransformComponentConstraintY { + static const int typeKey = 87; + @override + int get coreType => TranslationConstraintBase.typeKey; + @override + Set get coreTypes => { + TranslationConstraintBase.typeKey, + TransformComponentConstraintYBase.typeKey, + TransformComponentConstraintBase.typeKey, + TransformSpaceConstraintBase.typeKey, + TargetedConstraintBase.typeKey, + ConstraintBase.typeKey, + ComponentBase.typeKey + }; +} diff --git a/lib/src/generated/draw_rules_base.dart b/lib/src/generated/draw_rules_base.dart index 0ccee22..a093050 100644 --- a/lib/src/generated/draw_rules_base.dart +++ b/lib/src/generated/draw_rules_base.dart @@ -42,7 +42,7 @@ abstract class DrawRulesBase extends ContainerComponent { void drawTargetIdChanged(int from, int to); @override - void copy(DrawRulesBase source) { + void copy(covariant DrawRulesBase source) { super.copy(source); _drawTargetId = source._drawTargetId; } diff --git a/lib/src/generated/draw_target_base.dart b/lib/src/generated/draw_target_base.dart index 55f8bff..bf089d6 100644 --- a/lib/src/generated/draw_target_base.dart +++ b/lib/src/generated/draw_target_base.dart @@ -61,7 +61,7 @@ abstract class DrawTargetBase extends Component { void placementValueChanged(int from, int to); @override - void copy(DrawTargetBase source) { + void copy(covariant DrawTargetBase source) { super.copy(source); _drawableId = source._drawableId; _placementValue = source._placementValue; diff --git a/lib/src/generated/drawable_base.dart b/lib/src/generated/drawable_base.dart index 00b60dd..1c86e74 100644 --- a/lib/src/generated/drawable_base.dart +++ b/lib/src/generated/drawable_base.dart @@ -67,7 +67,7 @@ abstract class DrawableBase extends Node { void drawableFlagsChanged(int from, int to); @override - void copy(DrawableBase source) { + void copy(covariant DrawableBase source) { super.copy(source); _blendModeValue = source._blendModeValue; _drawableFlags = source._drawableFlags; diff --git a/lib/src/generated/node_base.dart b/lib/src/generated/node_base.dart index ac3b20c..8b10baf 100644 --- a/lib/src/generated/node_base.dart +++ b/lib/src/generated/node_base.dart @@ -67,7 +67,7 @@ abstract class NodeBase extends TransformComponent { void yChanged(double from, double to); @override - void copy(NodeBase source) { + void copy(covariant NodeBase source) { super.copy(source); _x = source._x; _y = source._y; diff --git a/lib/src/generated/rive_core_context.dart b/lib/src/generated/rive_core_context.dart index ee7fc4f..8aec4e2 100644 --- a/lib/src/generated/rive_core_context.dart +++ b/lib/src/generated/rive_core_context.dart @@ -20,6 +20,7 @@ import 'package:rive/src/generated/animation/exit_state_base.dart'; import 'package:rive/src/generated/animation/keyed_object_base.dart'; import 'package:rive/src/generated/animation/keyed_property_base.dart'; import 'package:rive/src/generated/animation/keyframe_base.dart'; +import 'package:rive/src/generated/animation/keyframe_bool_base.dart'; import 'package:rive/src/generated/animation/keyframe_color_base.dart'; import 'package:rive/src/generated/animation/keyframe_double_base.dart'; import 'package:rive/src/generated/animation/keyframe_id_base.dart'; @@ -48,8 +49,14 @@ import 'package:rive/src/generated/component_base.dart'; import 'package:rive/src/generated/constraints/constraint_base.dart'; import 'package:rive/src/generated/constraints/distance_constraint_base.dart'; import 'package:rive/src/generated/constraints/ik_constraint_base.dart'; +import 'package:rive/src/generated/constraints/rotation_constraint_base.dart'; +import 'package:rive/src/generated/constraints/scale_constraint_base.dart'; import 'package:rive/src/generated/constraints/targeted_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_component_constraint_y_base.dart'; import 'package:rive/src/generated/constraints/transform_constraint_base.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/generated/constraints/translation_constraint_base.dart'; import 'package:rive/src/generated/draw_rules_base.dart'; import 'package:rive/src/generated/draw_target_base.dart'; import 'package:rive/src/generated/drawable_base.dart'; @@ -91,6 +98,7 @@ import 'package:rive/src/rive_core/animation/entry_state.dart'; import 'package:rive/src/rive_core/animation/exit_state.dart'; import 'package:rive/src/rive_core/animation/keyed_object.dart'; import 'package:rive/src/rive_core/animation/keyed_property.dart'; +import 'package:rive/src/rive_core/animation/keyframe_bool.dart'; import 'package:rive/src/rive_core/animation/keyframe_color.dart'; import 'package:rive/src/rive_core/animation/keyframe_double.dart'; import 'package:rive/src/rive_core/animation/keyframe_id.dart'; @@ -114,7 +122,10 @@ import 'package:rive/src/rive_core/bones/tendon.dart'; import 'package:rive/src/rive_core/bones/weight.dart'; import 'package:rive/src/rive_core/constraints/distance_constraint.dart'; import 'package:rive/src/rive_core/constraints/ik_constraint.dart'; +import 'package:rive/src/rive_core/constraints/rotation_constraint.dart'; +import 'package:rive/src/rive_core/constraints/scale_constraint.dart'; import 'package:rive/src/rive_core/constraints/transform_constraint.dart'; +import 'package:rive/src/rive_core/constraints/translation_constraint.dart'; import 'package:rive/src/rive_core/draw_rules.dart'; import 'package:rive/src/rive_core/draw_target.dart'; import 'package:rive/src/rive_core/node.dart'; @@ -148,8 +159,14 @@ class RiveCoreContext { return DistanceConstraint(); case IKConstraintBase.typeKey: return IKConstraint(); + case TranslationConstraintBase.typeKey: + return TranslationConstraint(); case TransformConstraintBase.typeKey: return TransformConstraint(); + case ScaleConstraintBase.typeKey: + return ScaleConstraint(); + case RotationConstraintBase.typeKey: + return RotationConstraint(); case AnimationStateBase.typeKey: return AnimationState(); case KeyedObjectBase.typeKey: @@ -164,6 +181,8 @@ class RiveCoreContext { return KeyedProperty(); case KeyFrameIdBase.typeKey: return KeyFrameId(); + case KeyFrameBoolBase.typeKey: + return KeyFrameBool(); case TransitionNumberConditionBase.typeKey: return TransitionNumberCondition(); case AnyStateBase.typeKey: @@ -307,6 +326,86 @@ class RiveCoreContext { object.modeValue = value; } break; + case TransformSpaceConstraintBase.sourceSpaceValuePropertyKey: + if (object is TransformSpaceConstraintBase && value is int) { + object.sourceSpaceValue = value; + } + break; + case TransformSpaceConstraintBase.destSpaceValuePropertyKey: + if (object is TransformSpaceConstraintBase && value is int) { + object.destSpaceValue = value; + } + break; + case TransformComponentConstraintBase.minMaxSpaceValuePropertyKey: + if (object is TransformComponentConstraintBase && value is int) { + object.minMaxSpaceValue = value; + } + break; + case TransformComponentConstraintBase.copyFactorPropertyKey: + if (object is TransformComponentConstraintBase && value is double) { + object.copyFactor = value; + } + break; + case TransformComponentConstraintBase.minValuePropertyKey: + if (object is TransformComponentConstraintBase && value is double) { + object.minValue = value; + } + break; + case TransformComponentConstraintBase.maxValuePropertyKey: + if (object is TransformComponentConstraintBase && value is double) { + object.maxValue = value; + } + break; + case TransformComponentConstraintBase.offsetPropertyKey: + if (object is TransformComponentConstraintBase && value is bool) { + object.offset = value; + } + break; + case TransformComponentConstraintBase.doesCopyPropertyKey: + if (object is TransformComponentConstraintBase && value is bool) { + object.doesCopy = value; + } + break; + case TransformComponentConstraintBase.minPropertyKey: + if (object is TransformComponentConstraintBase && value is bool) { + object.min = value; + } + break; + case TransformComponentConstraintBase.maxPropertyKey: + if (object is TransformComponentConstraintBase && value is bool) { + object.max = value; + } + break; + case TransformComponentConstraintYBase.copyFactorYPropertyKey: + if (object is TransformComponentConstraintYBase && value is double) { + object.copyFactorY = value; + } + break; + case TransformComponentConstraintYBase.minValueYPropertyKey: + if (object is TransformComponentConstraintYBase && value is double) { + object.minValueY = value; + } + break; + case TransformComponentConstraintYBase.maxValueYPropertyKey: + if (object is TransformComponentConstraintYBase && value is double) { + object.maxValueY = value; + } + break; + case TransformComponentConstraintYBase.doesCopyYPropertyKey: + if (object is TransformComponentConstraintYBase && value is bool) { + object.doesCopyY = value; + } + break; + case TransformComponentConstraintYBase.minYPropertyKey: + if (object is TransformComponentConstraintYBase && value is bool) { + object.minY = value; + } + break; + case TransformComponentConstraintYBase.maxYPropertyKey: + if (object is TransformComponentConstraintYBase && value is bool) { + object.maxY = value; + } + break; case IKConstraintBase.invertDirectionPropertyKey: if (object is IKConstraintBase && value is bool) { object.invertDirection = value; @@ -317,16 +416,6 @@ class RiveCoreContext { object.parentBoneCount = value; } break; - case TransformConstraintBase.sourceSpaceValuePropertyKey: - if (object is TransformConstraintBase && value is int) { - object.sourceSpaceValue = value; - } - break; - case TransformConstraintBase.destSpaceValuePropertyKey: - if (object is TransformConstraintBase && value is int) { - object.destSpaceValue = value; - } - break; case AnimationStateBase.animationIdPropertyKey: if (object is AnimationStateBase && value is int) { object.animationId = value; @@ -387,6 +476,11 @@ class RiveCoreContext { object.value = value; } break; + case KeyFrameBoolBase.valuePropertyKey: + if (object is KeyFrameBoolBase && value is bool) { + object.value = value; + } + break; case TransitionValueConditionBase.opValuePropertyKey: if (object is TransitionValueConditionBase && value is int) { object.opValue = value; @@ -946,9 +1040,10 @@ class RiveCoreContext { case DrawTargetBase.placementValuePropertyKey: case TargetedConstraintBase.targetIdPropertyKey: case DistanceConstraintBase.modeValuePropertyKey: + case TransformSpaceConstraintBase.sourceSpaceValuePropertyKey: + case TransformSpaceConstraintBase.destSpaceValuePropertyKey: + case TransformComponentConstraintBase.minMaxSpaceValuePropertyKey: case IKConstraintBase.parentBoneCountPropertyKey: - case TransformConstraintBase.sourceSpaceValuePropertyKey: - case TransformConstraintBase.destSpaceValuePropertyKey: case AnimationStateBase.animationIdPropertyKey: case KeyedObjectBase.objectIdPropertyKey: case BlendAnimationBase.animationIdPropertyKey: @@ -992,6 +1087,12 @@ class RiveCoreContext { return uintType; case ConstraintBase.strengthPropertyKey: case DistanceConstraintBase.distancePropertyKey: + case TransformComponentConstraintBase.copyFactorPropertyKey: + case TransformComponentConstraintBase.minValuePropertyKey: + case TransformComponentConstraintBase.maxValuePropertyKey: + case TransformComponentConstraintYBase.copyFactorYPropertyKey: + case TransformComponentConstraintYBase.minValueYPropertyKey: + case TransformComponentConstraintYBase.maxValueYPropertyKey: case StateMachineNumberBase.valuePropertyKey: case TransitionNumberConditionBase.valuePropertyKey: case CubicInterpolatorBase.x1PropertyKey: @@ -1061,7 +1162,15 @@ class RiveCoreContext { case TendonBase.txPropertyKey: case TendonBase.tyPropertyKey: return doubleType; + case TransformComponentConstraintBase.offsetPropertyKey: + case TransformComponentConstraintBase.doesCopyPropertyKey: + case TransformComponentConstraintBase.minPropertyKey: + case TransformComponentConstraintBase.maxPropertyKey: + case TransformComponentConstraintYBase.doesCopyYPropertyKey: + case TransformComponentConstraintYBase.minYPropertyKey: + case TransformComponentConstraintYBase.maxYPropertyKey: case IKConstraintBase.invertDirectionPropertyKey: + case KeyFrameBoolBase.valuePropertyKey: case LinearAnimationBase.enableWorkAreaPropertyKey: case StateMachineBoolBase.valuePropertyKey: case ShapePaintBase.isVisiblePropertyKey: @@ -1103,12 +1212,14 @@ class RiveCoreContext { return (object as TargetedConstraintBase).targetId; case DistanceConstraintBase.modeValuePropertyKey: return (object as DistanceConstraintBase).modeValue; + case TransformSpaceConstraintBase.sourceSpaceValuePropertyKey: + return (object as TransformSpaceConstraintBase).sourceSpaceValue; + case TransformSpaceConstraintBase.destSpaceValuePropertyKey: + return (object as TransformSpaceConstraintBase).destSpaceValue; + case TransformComponentConstraintBase.minMaxSpaceValuePropertyKey: + return (object as TransformComponentConstraintBase).minMaxSpaceValue; case IKConstraintBase.parentBoneCountPropertyKey: return (object as IKConstraintBase).parentBoneCount; - case TransformConstraintBase.sourceSpaceValuePropertyKey: - return (object as TransformConstraintBase).sourceSpaceValue; - case TransformConstraintBase.destSpaceValuePropertyKey: - return (object as TransformConstraintBase).destSpaceValue; case AnimationStateBase.animationIdPropertyKey: return (object as AnimationStateBase).animationId; case KeyedObjectBase.objectIdPropertyKey: @@ -1199,6 +1310,18 @@ class RiveCoreContext { return (object as ConstraintBase).strength; case DistanceConstraintBase.distancePropertyKey: return (object as DistanceConstraintBase).distance; + case TransformComponentConstraintBase.copyFactorPropertyKey: + return (object as TransformComponentConstraintBase).copyFactor; + case TransformComponentConstraintBase.minValuePropertyKey: + return (object as TransformComponentConstraintBase).minValue; + case TransformComponentConstraintBase.maxValuePropertyKey: + return (object as TransformComponentConstraintBase).maxValue; + case TransformComponentConstraintYBase.copyFactorYPropertyKey: + return (object as TransformComponentConstraintYBase).copyFactorY; + case TransformComponentConstraintYBase.minValueYPropertyKey: + return (object as TransformComponentConstraintYBase).minValueY; + case TransformComponentConstraintYBase.maxValueYPropertyKey: + return (object as TransformComponentConstraintYBase).maxValueY; case StateMachineNumberBase.valuePropertyKey: return (object as StateMachineNumberBase).value; case TransitionNumberConditionBase.valuePropertyKey: @@ -1341,8 +1464,24 @@ class RiveCoreContext { static bool getBool(Core object, int propertyKey) { switch (propertyKey) { + case TransformComponentConstraintBase.offsetPropertyKey: + return (object as TransformComponentConstraintBase).offset; + case TransformComponentConstraintBase.doesCopyPropertyKey: + return (object as TransformComponentConstraintBase).doesCopy; + case TransformComponentConstraintBase.minPropertyKey: + return (object as TransformComponentConstraintBase).min; + case TransformComponentConstraintBase.maxPropertyKey: + return (object as TransformComponentConstraintBase).max; + case TransformComponentConstraintYBase.doesCopyYPropertyKey: + return (object as TransformComponentConstraintYBase).doesCopyY; + case TransformComponentConstraintYBase.minYPropertyKey: + return (object as TransformComponentConstraintYBase).minY; + case TransformComponentConstraintYBase.maxYPropertyKey: + return (object as TransformComponentConstraintYBase).maxY; case IKConstraintBase.invertDirectionPropertyKey: return (object as IKConstraintBase).invertDirection; + case KeyFrameBoolBase.valuePropertyKey: + return (object as KeyFrameBoolBase).value; case LinearAnimationBase.enableWorkAreaPropertyKey: return (object as LinearAnimationBase).enableWorkArea; case StateMachineBoolBase.valuePropertyKey: @@ -1420,21 +1559,26 @@ class RiveCoreContext { object.modeValue = value; } break; - case IKConstraintBase.parentBoneCountPropertyKey: - if (object is IKConstraintBase) { - object.parentBoneCount = value; - } - break; - case TransformConstraintBase.sourceSpaceValuePropertyKey: - if (object is TransformConstraintBase) { + case TransformSpaceConstraintBase.sourceSpaceValuePropertyKey: + if (object is TransformSpaceConstraintBase) { object.sourceSpaceValue = value; } break; - case TransformConstraintBase.destSpaceValuePropertyKey: - if (object is TransformConstraintBase) { + case TransformSpaceConstraintBase.destSpaceValuePropertyKey: + if (object is TransformSpaceConstraintBase) { object.destSpaceValue = value; } break; + case TransformComponentConstraintBase.minMaxSpaceValuePropertyKey: + if (object is TransformComponentConstraintBase) { + object.minMaxSpaceValue = value; + } + break; + case IKConstraintBase.parentBoneCountPropertyKey: + if (object is IKConstraintBase) { + object.parentBoneCount = value; + } + break; case AnimationStateBase.animationIdPropertyKey: if (object is AnimationStateBase) { object.animationId = value; @@ -1650,6 +1794,36 @@ class RiveCoreContext { object.distance = value; } break; + case TransformComponentConstraintBase.copyFactorPropertyKey: + if (object is TransformComponentConstraintBase) { + object.copyFactor = value; + } + break; + case TransformComponentConstraintBase.minValuePropertyKey: + if (object is TransformComponentConstraintBase) { + object.minValue = value; + } + break; + case TransformComponentConstraintBase.maxValuePropertyKey: + if (object is TransformComponentConstraintBase) { + object.maxValue = value; + } + break; + case TransformComponentConstraintYBase.copyFactorYPropertyKey: + if (object is TransformComponentConstraintYBase) { + object.copyFactorY = value; + } + break; + case TransformComponentConstraintYBase.minValueYPropertyKey: + if (object is TransformComponentConstraintYBase) { + object.minValueY = value; + } + break; + case TransformComponentConstraintYBase.maxValueYPropertyKey: + if (object is TransformComponentConstraintYBase) { + object.maxValueY = value; + } + break; case StateMachineNumberBase.valuePropertyKey: if (object is StateMachineNumberBase) { object.value = value; @@ -1995,11 +2169,51 @@ class RiveCoreContext { static void setBool(Core object, int propertyKey, bool value) { switch (propertyKey) { + case TransformComponentConstraintBase.offsetPropertyKey: + if (object is TransformComponentConstraintBase) { + object.offset = value; + } + break; + case TransformComponentConstraintBase.doesCopyPropertyKey: + if (object is TransformComponentConstraintBase) { + object.doesCopy = value; + } + break; + case TransformComponentConstraintBase.minPropertyKey: + if (object is TransformComponentConstraintBase) { + object.min = value; + } + break; + case TransformComponentConstraintBase.maxPropertyKey: + if (object is TransformComponentConstraintBase) { + object.max = value; + } + break; + case TransformComponentConstraintYBase.doesCopyYPropertyKey: + if (object is TransformComponentConstraintYBase) { + object.doesCopyY = value; + } + break; + case TransformComponentConstraintYBase.minYPropertyKey: + if (object is TransformComponentConstraintYBase) { + object.minY = value; + } + break; + case TransformComponentConstraintYBase.maxYPropertyKey: + if (object is TransformComponentConstraintYBase) { + object.maxY = value; + } + break; case IKConstraintBase.invertDirectionPropertyKey: if (object is IKConstraintBase) { object.invertDirection = value; } break; + case KeyFrameBoolBase.valuePropertyKey: + if (object is KeyFrameBoolBase) { + object.value = value; + } + break; case LinearAnimationBase.enableWorkAreaPropertyKey: if (object is LinearAnimationBase) { object.enableWorkArea = value; diff --git a/lib/src/generated/shapes/clipping_shape_base.dart b/lib/src/generated/shapes/clipping_shape_base.dart index def536f..c8d291f 100644 --- a/lib/src/generated/shapes/clipping_shape_base.dart +++ b/lib/src/generated/shapes/clipping_shape_base.dart @@ -83,7 +83,7 @@ abstract class ClippingShapeBase extends Component { void isVisibleChanged(bool from, bool to); @override - void copy(ClippingShapeBase source) { + void copy(covariant ClippingShapeBase source) { super.copy(source); _sourceId = source._sourceId; _fillRule = source._fillRule; diff --git a/lib/src/generated/shapes/cubic_asymmetric_vertex_base.dart b/lib/src/generated/shapes/cubic_asymmetric_vertex_base.dart index 058232e..4e80dfa 100644 --- a/lib/src/generated/shapes/cubic_asymmetric_vertex_base.dart +++ b/lib/src/generated/shapes/cubic_asymmetric_vertex_base.dart @@ -95,7 +95,7 @@ abstract class CubicAsymmetricVertexBase extends CubicVertex { void outDistanceChanged(double from, double to); @override - void copy(CubicAsymmetricVertexBase source) { + void copy(covariant CubicAsymmetricVertexBase source) { super.copy(source); _rotation = source._rotation; _inDistance = source._inDistance; diff --git a/lib/src/generated/shapes/cubic_detached_vertex_base.dart b/lib/src/generated/shapes/cubic_detached_vertex_base.dart index 3e26edb..2df9d2a 100644 --- a/lib/src/generated/shapes/cubic_detached_vertex_base.dart +++ b/lib/src/generated/shapes/cubic_detached_vertex_base.dart @@ -120,7 +120,7 @@ abstract class CubicDetachedVertexBase extends CubicVertex { void outDistanceChanged(double from, double to); @override - void copy(CubicDetachedVertexBase source) { + void copy(covariant CubicDetachedVertexBase source) { super.copy(source); _inRotation = source._inRotation; _inDistance = source._inDistance; diff --git a/lib/src/generated/shapes/cubic_mirrored_vertex_base.dart b/lib/src/generated/shapes/cubic_mirrored_vertex_base.dart index bce005a..f84ead0 100644 --- a/lib/src/generated/shapes/cubic_mirrored_vertex_base.dart +++ b/lib/src/generated/shapes/cubic_mirrored_vertex_base.dart @@ -70,7 +70,7 @@ abstract class CubicMirroredVertexBase extends CubicVertex { void distanceChanged(double from, double to); @override - void copy(CubicMirroredVertexBase source) { + void copy(covariant CubicMirroredVertexBase source) { super.copy(source); _rotation = source._rotation; _distance = source._distance; diff --git a/lib/src/generated/shapes/paint/fill_base.dart b/lib/src/generated/shapes/paint/fill_base.dart index 1f400b8..4756d54 100644 --- a/lib/src/generated/shapes/paint/fill_base.dart +++ b/lib/src/generated/shapes/paint/fill_base.dart @@ -41,7 +41,7 @@ abstract class FillBase extends ShapePaint { void fillRuleChanged(int from, int to); @override - void copy(FillBase source) { + void copy(covariant FillBase source) { super.copy(source); _fillRule = source._fillRule; } diff --git a/lib/src/generated/shapes/paint/gradient_stop_base.dart b/lib/src/generated/shapes/paint/gradient_stop_base.dart index 8b090db..7ebfcbb 100644 --- a/lib/src/generated/shapes/paint/gradient_stop_base.dart +++ b/lib/src/generated/shapes/paint/gradient_stop_base.dart @@ -57,7 +57,7 @@ abstract class GradientStopBase extends Component { void positionChanged(double from, double to); @override - void copy(GradientStopBase source) { + void copy(covariant GradientStopBase source) { super.copy(source); _colorValue = source._colorValue; _position = source._position; diff --git a/lib/src/generated/shapes/paint/linear_gradient_base.dart b/lib/src/generated/shapes/paint/linear_gradient_base.dart index 52f4ec1..305e5a1 100644 --- a/lib/src/generated/shapes/paint/linear_gradient_base.dart +++ b/lib/src/generated/shapes/paint/linear_gradient_base.dart @@ -128,7 +128,7 @@ abstract class LinearGradientBase extends ContainerComponent { void opacityChanged(double from, double to); @override - void copy(LinearGradientBase source) { + void copy(covariant LinearGradientBase source) { super.copy(source); _startX = source._startX; _startY = source._startY; diff --git a/lib/src/generated/shapes/paint/shape_paint_base.dart b/lib/src/generated/shapes/paint/shape_paint_base.dart index 4837cc9..31c7db0 100644 --- a/lib/src/generated/shapes/paint/shape_paint_base.dart +++ b/lib/src/generated/shapes/paint/shape_paint_base.dart @@ -40,7 +40,7 @@ abstract class ShapePaintBase extends ContainerComponent { void isVisibleChanged(bool from, bool to); @override - void copy(ShapePaintBase source) { + void copy(covariant ShapePaintBase source) { super.copy(source); _isVisible = source._isVisible; } diff --git a/lib/src/generated/shapes/paint/solid_color_base.dart b/lib/src/generated/shapes/paint/solid_color_base.dart index 6338af1..859f30a 100644 --- a/lib/src/generated/shapes/paint/solid_color_base.dart +++ b/lib/src/generated/shapes/paint/solid_color_base.dart @@ -35,7 +35,7 @@ abstract class SolidColorBase extends Component { void colorValueChanged(int from, int to); @override - void copy(SolidColorBase source) { + void copy(covariant SolidColorBase source) { super.copy(source); _colorValue = source._colorValue; } diff --git a/lib/src/generated/shapes/paint/stroke_base.dart b/lib/src/generated/shapes/paint/stroke_base.dart index 7655615..af00520 100644 --- a/lib/src/generated/shapes/paint/stroke_base.dart +++ b/lib/src/generated/shapes/paint/stroke_base.dart @@ -109,7 +109,7 @@ abstract class StrokeBase extends ShapePaint { void transformAffectsStrokeChanged(bool from, bool to); @override - void copy(StrokeBase source) { + void copy(covariant StrokeBase source) { super.copy(source); _thickness = source._thickness; _cap = source._cap; diff --git a/lib/src/generated/shapes/paint/trim_path_base.dart b/lib/src/generated/shapes/paint/trim_path_base.dart index 8181e2d..3a5f659 100644 --- a/lib/src/generated/shapes/paint/trim_path_base.dart +++ b/lib/src/generated/shapes/paint/trim_path_base.dart @@ -101,7 +101,7 @@ abstract class TrimPathBase extends Component { void modeValueChanged(int from, int to); @override - void copy(TrimPathBase source) { + void copy(covariant TrimPathBase source) { super.copy(source); _start = source._start; _end = source._end; diff --git a/lib/src/generated/shapes/parametric_path_base.dart b/lib/src/generated/shapes/parametric_path_base.dart index a48e7cf..d9ee7ab 100644 --- a/lib/src/generated/shapes/parametric_path_base.dart +++ b/lib/src/generated/shapes/parametric_path_base.dart @@ -120,7 +120,7 @@ abstract class ParametricPathBase extends Path { void originYChanged(double from, double to); @override - void copy(ParametricPathBase source) { + void copy(covariant ParametricPathBase source) { super.copy(source); _width = source._width; _height = source._height; diff --git a/lib/src/generated/shapes/path_base.dart b/lib/src/generated/shapes/path_base.dart index ad2224e..2b78d93 100644 --- a/lib/src/generated/shapes/path_base.dart +++ b/lib/src/generated/shapes/path_base.dart @@ -43,7 +43,7 @@ abstract class PathBase extends Node { void pathFlagsChanged(int from, int to); @override - void copy(PathBase source) { + void copy(covariant PathBase source) { super.copy(source); _pathFlags = source._pathFlags; } diff --git a/lib/src/generated/shapes/path_vertex_base.dart b/lib/src/generated/shapes/path_vertex_base.dart index 9e55f93..9f5fee4 100644 --- a/lib/src/generated/shapes/path_vertex_base.dart +++ b/lib/src/generated/shapes/path_vertex_base.dart @@ -65,7 +65,7 @@ abstract class PathVertexBase extends ContainerComponent { void yChanged(double from, double to); @override - void copy(PathVertexBase source) { + void copy(covariant PathVertexBase source) { super.copy(source); _x = source._x; _y = source._y; diff --git a/lib/src/generated/shapes/points_path_base.dart b/lib/src/generated/shapes/points_path_base.dart index fab3980..f9edcae 100644 --- a/lib/src/generated/shapes/points_path_base.dart +++ b/lib/src/generated/shapes/points_path_base.dart @@ -48,7 +48,7 @@ abstract class PointsPathBase extends Path { void isClosedChanged(bool from, bool to); @override - void copy(PointsPathBase source) { + void copy(covariant PointsPathBase source) { super.copy(source); _isClosed = source._isClosed; } diff --git a/lib/src/generated/shapes/polygon_base.dart b/lib/src/generated/shapes/polygon_base.dart index 73d6352..337636f 100644 --- a/lib/src/generated/shapes/polygon_base.dart +++ b/lib/src/generated/shapes/polygon_base.dart @@ -74,7 +74,7 @@ abstract class PolygonBase extends ParametricPath { void cornerRadiusChanged(double from, double to); @override - void copy(PolygonBase source) { + void copy(covariant PolygonBase source) { super.copy(source); _points = source._points; _cornerRadius = source._cornerRadius; diff --git a/lib/src/generated/shapes/rectangle_base.dart b/lib/src/generated/shapes/rectangle_base.dart index e6060f5..3e0deab 100644 --- a/lib/src/generated/shapes/rectangle_base.dart +++ b/lib/src/generated/shapes/rectangle_base.dart @@ -150,7 +150,7 @@ abstract class RectangleBase extends ParametricPath { void cornerRadiusBRChanged(double from, double to); @override - void copy(RectangleBase source) { + void copy(covariant RectangleBase source) { super.copy(source); _linkCornerRadius = source._linkCornerRadius; _cornerRadiusTL = source._cornerRadiusTL; diff --git a/lib/src/generated/shapes/star_base.dart b/lib/src/generated/shapes/star_base.dart index 888335c..e2501ce 100644 --- a/lib/src/generated/shapes/star_base.dart +++ b/lib/src/generated/shapes/star_base.dart @@ -52,7 +52,7 @@ abstract class StarBase extends Polygon { void innerRadiusChanged(double from, double to); @override - void copy(StarBase source) { + void copy(covariant StarBase source) { super.copy(source); _innerRadius = source._innerRadius; } diff --git a/lib/src/generated/shapes/straight_vertex_base.dart b/lib/src/generated/shapes/straight_vertex_base.dart index d0a294c..657cc53 100644 --- a/lib/src/generated/shapes/straight_vertex_base.dart +++ b/lib/src/generated/shapes/straight_vertex_base.dart @@ -45,7 +45,7 @@ abstract class StraightVertexBase extends PathVertex { void radiusChanged(double from, double to); @override - void copy(StraightVertexBase source) { + void copy(covariant StraightVertexBase source) { super.copy(source); _radius = source._radius; } diff --git a/lib/src/generated/transform_component_base.dart b/lib/src/generated/transform_component_base.dart index 32a5c2e..e3bc7f1 100644 --- a/lib/src/generated/transform_component_base.dart +++ b/lib/src/generated/transform_component_base.dart @@ -106,7 +106,7 @@ abstract class TransformComponentBase extends ContainerComponent { void opacityChanged(double from, double to); @override - void copy(TransformComponentBase source) { + void copy(covariant TransformComponentBase source) { super.copy(source); _rotation = source._rotation; _scaleX = source._scaleX; diff --git a/lib/src/rive_core/animation/keyframe_bool.dart b/lib/src/rive_core/animation/keyframe_bool.dart new file mode 100644 index 0000000..9bf1554 --- /dev/null +++ b/lib/src/rive_core/animation/keyframe_bool.dart @@ -0,0 +1,24 @@ +import 'package:rive/src/core/core.dart'; +import 'package:rive/src/generated/animation/keyframe_bool_base.dart'; +import 'package:rive/src/generated/rive_core_context.dart'; +export 'package:rive/src/generated/animation/keyframe_bool_base.dart'; + +/// KeyFrame for animating bool properties. +class KeyFrameBool extends KeyFrameBoolBase { + @override + bool get canInterpolate => false; + + @override + void apply(Core object, int propertyKey, double mix) { + RiveCoreContext.setBool(object, propertyKey, value); + } + + @override + void applyInterpolation(Core object, int propertyKey, + double currentTime, KeyFrameBool nextFrame, double mix) { + RiveCoreContext.setBool(object, propertyKey, value); + } + + @override + void valueChanged(bool from, bool to) {} +} diff --git a/lib/src/rive_core/animation/keyframe_double.dart b/lib/src/rive_core/animation/keyframe_double.dart index 4dab3c9..ec1a07f 100644 --- a/lib/src/rive_core/animation/keyframe_double.dart +++ b/lib/src/rive_core/animation/keyframe_double.dart @@ -3,10 +3,6 @@ import 'package:rive/src/generated/animation/keyframe_double_base.dart'; import 'package:rive/src/generated/rive_core_context.dart'; export 'package:rive/src/generated/animation/keyframe_double_base.dart'; -double toDegrees(double rad) { - return rad / 3.14 * 180; -} - void _apply( Core object, int propertyKey, double mix, double value) { if (mix == 1) { diff --git a/lib/src/rive_core/component_flags.dart b/lib/src/rive_core/component_flags.dart index 0b48151..ed2e70b 100644 --- a/lib/src/rive_core/component_flags.dart +++ b/lib/src/rive_core/component_flags.dart @@ -5,4 +5,46 @@ class ComponentFlags { // Whether the component was locked for editing in the editor. static const int locked = 1 << 1; + + /// These options are used by [TransformComponentConstraint]s, any other + /// component that's not in that class hierarchy can re-use these values as + /// they won't collide. + /// + /// ----------- + + /// Whether the [TransformComponentConstraint]'s constrained value is offset + /// from the design time value (in the matching space). + static const int offset = 1 << 2; + + /// Whether the transform component is copied. + static const int copy = 1 << 3; + + /// Set when a minimum value should be applied to the constrained value. + static const int min = 1 << 4; + + /// Set when a maximum value should be applied to the constrained value. + static const int max = 1 << 5; + + /// Whether an X transform component is copied. + static const int copyX = 1 << 3; + + /// Set when a minimum value should be applied to the constrained X value. + static const int minX = 1 << 4; + + /// Set when a maximum value should be applied to the constrained X value. + static const int maxX = 1 << 5; + + /// Whether a Y transform component is copied. + static const int copyY = 1 << 6; + + /// Set when a minimum value should be applied to the constrained Y value. + static const int minY = 1 << 7; + + /// Set when a maximum value should be applied to the constrained Y value. + static const int maxY = 1 << 8; + + /// End of TransformComponentConstraint + /// + /// ---------- + } diff --git a/lib/src/rive_core/constraints/rotation_constraint.dart b/lib/src/rive_core/constraints/rotation_constraint.dart new file mode 100644 index 0000000..69d9032 --- /dev/null +++ b/lib/src/rive_core/constraints/rotation_constraint.dart @@ -0,0 +1,101 @@ +import 'dart:math'; + +import 'package:rive/src/rive_core/constraints/constraint.dart'; +import 'package:rive/src/rive_core/math/mat2d.dart'; +import 'package:rive/src/rive_core/math/transform_components.dart'; +import 'package:rive/src/generated/constraints/rotation_constraint_base.dart'; +import 'package:rive/src/rive_core/transform_component.dart'; +import 'package:rive/src/rive_core/transform_space.dart'; +export 'package:rive/src/generated/constraints/rotation_constraint_base.dart'; + +/// A constraint copies the rotation from the target component to the +/// constrained component in world or local space and applies copy/min/max +/// rules. +class RotationConstraint extends RotationConstraintBase { + @override + void constrain(TransformComponent component) { + var transformA = component.worldTransform; + var transformB = Mat2D(); + Mat2D.decompose(transformA, componentsA); + if (target == null) { + Mat2D.copy(transformB, transformA); + TransformComponents.copy(componentsB, componentsA); + } else { + Mat2D.copy(transformB, target!.worldTransform); + if (sourceSpace == TransformSpace.local) { + var inverse = Mat2D(); + + if (!Mat2D.invert(inverse, parentWorld(target!))) { + return; + } + Mat2D.multiply(transformB, inverse, transformB); + } + + Mat2D.decompose(transformB, componentsB); + + if (!doesCopy) { + componentsB.rotation = + destSpace == TransformSpace.local ? 1 : componentsA.rotation; + } else { + componentsB.rotation = componentsB.rotation * copyFactor; + if (offset) { + componentsB.rotation = componentsB.rotation + component.rotation; + } + } + + if (destSpace == TransformSpace.local) { + // Destination space is in parent transform coordinates. Recompose the + // parent local transform and get it in world, then decompose the world + // for interpolation. + + Mat2D.compose(transformB, componentsB); + var grandParentWorld = parentWorld(component); + Mat2D.multiply(transformB, grandParentWorld, transformB); + Mat2D.decompose(transformB, componentsB); + } + } + bool clampLocal = minMaxSpace == TransformSpace.local; + if (clampLocal) { + // Apply min max in local space, so transform to local coordinates first. + Mat2D.compose(transformB, componentsB); + Mat2D inverse = Mat2D(); + if (!Mat2D.invert(inverse, parentWorld(component))) { + return; + } + Mat2D.multiply(transformB, inverse, transformB); + Mat2D.decompose(transformB, componentsB); + } + if (this.max && componentsB.rotation > maxValue) { + componentsB.rotation = maxValue; + } + if (this.min && componentsB.rotation < minValue) { + componentsB.rotation = minValue; + } + if (clampLocal) { + // Transform back to world. + Mat2D.compose(transformB, componentsB); + Mat2D.multiply(transformB, parentWorld(component), transformB); + Mat2D.decompose(transformB, componentsB); + } + + var pi2 = pi * 2; + var angleA = componentsA.rotation % pi2; + var angleB = componentsB.rotation % pi2; + var diff = angleB - angleA; + + if (diff > pi) { + diff -= pi2; + } else if (diff < -pi) { + diff += pi2; + } + + componentsB.rotation = componentsA.rotation + diff * strength; + componentsB.x = componentsA.x; + componentsB.y = componentsA.y; + componentsB.scaleX = componentsA.scaleX; + componentsB.scaleY = componentsA.scaleY; + componentsB.skew = componentsA.skew; + + Mat2D.compose(component.worldTransform, componentsB); + } +} diff --git a/lib/src/rive_core/constraints/scale_constraint.dart b/lib/src/rive_core/constraints/scale_constraint.dart new file mode 100644 index 0000000..e7a96af --- /dev/null +++ b/lib/src/rive_core/constraints/scale_constraint.dart @@ -0,0 +1,106 @@ +import 'package:rive/src/rive_core/constraints/constraint.dart'; +import 'package:rive/src/rive_core/math/mat2d.dart'; +import 'package:rive/src/rive_core/math/transform_components.dart'; +import 'package:rive/src/generated/constraints/scale_constraint_base.dart'; +import 'package:rive/src/rive_core/transform_component.dart'; +import 'package:rive/src/rive_core/transform_space.dart'; +export 'package:rive/src/generated/constraints/scale_constraint_base.dart'; + +/// A constraint copies the scale from the target component to the +/// constrained component in world or local space and applies copy/min/max +/// rules. +class ScaleConstraint extends ScaleConstraintBase { + @override + void constrain(TransformComponent component) { + var transformA = component.worldTransform; + var transformB = Mat2D(); + Mat2D.decompose(transformA, componentsA); + if (target == null) { + Mat2D.copy(transformB, transformA); + TransformComponents.copy(componentsB, componentsA); + } else { + Mat2D.copy(transformB, target!.worldTransform); + if (sourceSpace == TransformSpace.local) { + var inverse = Mat2D(); + if (!Mat2D.invert(inverse, parentWorld(target!))) { + return; + } + Mat2D.multiply(transformB, inverse, transformB); + } + Mat2D.decompose(transformB, componentsB); + + if (!doesCopy) { + componentsB.scaleX = + destSpace == TransformSpace.local ? 1 : componentsA.scaleX; + } else { + componentsB.scaleX = componentsB.scaleX * copyFactor; + if (offset) { + componentsB.scaleX = componentsB.scaleX * component.scaleX; + } + } + + if (!doesCopyY) { + componentsB.scaleY = + destSpace == TransformSpace.local ? 0 : componentsA.scaleY; + } else { + componentsB.scaleY = componentsB.scaleY * copyFactorY; + if (offset) { + componentsB.scaleY = componentsB.scaleY * component.scaleY; + } + } + + if (destSpace == TransformSpace.local) { + // Destination space is in parent transform coordinates. Recompose the + // parent local transform and get it in world, then decompose the world + // for interpolation. + + Mat2D.compose(transformB, componentsB); + Mat2D.multiply(transformB, parentWorld(component), transformB); + Mat2D.decompose(transformB, componentsB); + } + } + + bool clamplocal = minMaxSpace == TransformSpace.local; + if (clamplocal) { + // Apply min max in local space, so transform to local coordinates first. + Mat2D.compose(transformB, componentsB); + var inverse = Mat2D(); + if (!Mat2D.invert(inverse, parentWorld(component))) { + return; + } + Mat2D.multiply(transformB, inverse, transformB); + Mat2D.decompose(transformB, componentsB); + } + if (max && componentsB.scaleX > maxValue) { + componentsB.scaleX = maxValue; + } + if (min && componentsB.scaleX < minValue) { + componentsB.scaleX = minValue; + } + if (maxY && componentsB.scaleY > maxValueY) { + componentsB.scaleY = maxValueY; + } + if (minY && componentsB.scaleY < minValueY) { + componentsB.scaleY = minValueY; + } + if (clamplocal) { + // Transform back to world. + Mat2D.compose(transformB, componentsB); + Mat2D.multiply(transformB, parentWorld(component), transformB); + Mat2D.decompose(transformB, componentsB); + } + + var ti = 1 - strength; + + componentsB.rotation = componentsA.rotation; + componentsB.x = componentsA.x; + componentsB.y = componentsA.y; + componentsB.scaleX = + componentsA.scaleX * ti + componentsB.scaleX * strength; + componentsB.scaleY = + componentsA.scaleY * ti + componentsB.scaleY * strength; + componentsB.skew = componentsA.skew; + + Mat2D.compose(component.worldTransform, componentsB); + } +} diff --git a/lib/src/rive_core/constraints/transform_component_constraint.dart b/lib/src/rive_core/constraints/transform_component_constraint.dart new file mode 100644 index 0000000..c9cb48b --- /dev/null +++ b/lib/src/rive_core/constraints/transform_component_constraint.dart @@ -0,0 +1,33 @@ +import 'package:rive/src/generated/constraints/transform_component_constraint_base.dart'; +import 'package:rive/src/rive_core/transform_space.dart'; +export 'package:rive/src/generated/constraints/transform_component_constraint_base.dart'; + +abstract class TransformComponentConstraint + extends TransformComponentConstraintBase { + TransformSpace get minMaxSpace => TransformSpace.values[minMaxSpaceValue]; + set minMaxSpace(TransformSpace value) => minMaxSpaceValue = value.index; + + @override + void minMaxSpaceValueChanged(int from, int to) => markConstraintDirty(); + + @override + void minValueChanged(double from, double to) => markConstraintDirty(); + + @override + void maxValueChanged(double from, double to) => markConstraintDirty(); + + @override + void copyFactorChanged(double from, double to) => markConstraintDirty(); + + @override + void doesCopyChanged(bool from, bool to) => markConstraintDirty(); + + @override + void maxChanged(bool from, bool to) => markConstraintDirty(); + + @override + void minChanged(bool from, bool to) => markConstraintDirty(); + + @override + void offsetChanged(bool from, bool to) => markConstraintDirty(); +} diff --git a/lib/src/rive_core/constraints/transform_component_constraint_y.dart b/lib/src/rive_core/constraints/transform_component_constraint_y.dart new file mode 100644 index 0000000..d7ddfba --- /dev/null +++ b/lib/src/rive_core/constraints/transform_component_constraint_y.dart @@ -0,0 +1,23 @@ +import 'package:rive/src/generated/constraints/transform_component_constraint_y_base.dart'; +export 'package:rive/src/generated/constraints/transform_component_constraint_y_base.dart'; + +abstract class TransformComponentConstraintY + extends TransformComponentConstraintYBase { + @override + void minValueYChanged(double from, double to) => markConstraintDirty(); + + @override + void maxValueYChanged(double from, double to) => markConstraintDirty(); + + @override + void copyFactorYChanged(double from, double to) => markConstraintDirty(); + + @override + void doesCopyYChanged(bool from, bool to) => markConstraintDirty(); + + @override + void maxYChanged(bool from, bool to) => markConstraintDirty(); + + @override + void minYChanged(bool from, bool to) => markConstraintDirty(); +} diff --git a/lib/src/rive_core/constraints/transform_constraint.dart b/lib/src/rive_core/constraints/transform_constraint.dart index 819a1fd..6449812 100644 --- a/lib/src/rive_core/constraints/transform_constraint.dart +++ b/lib/src/rive_core/constraints/transform_constraint.dart @@ -2,7 +2,6 @@ import 'dart:math'; import 'package:rive/src/rive_core/constraints/constraint.dart'; import 'package:rive/src/rive_core/math/mat2d.dart'; -import 'package:rive/src/rive_core/math/transform_components.dart'; import 'package:rive/src/generated/constraints/transform_constraint_base.dart'; import 'package:rive/src/rive_core/transform_component.dart'; import 'package:rive/src/rive_core/transform_space.dart'; @@ -11,21 +10,6 @@ export 'package:rive/src/generated/constraints/transform_constraint_base.dart'; /// A constraint copies the transform from the target component to the /// constrained component in world or local space. class TransformConstraint extends TransformConstraintBase { - final TransformComponents componentsA = TransformComponents(); - final TransformComponents componentsB = TransformComponents(); - - TransformSpace get destSpace => TransformSpace.values[destSpaceValue]; - set destSpace(TransformSpace value) => destSpaceValue = value.index; - - TransformSpace get sourceSpace => TransformSpace.values[sourceSpaceValue]; - set sourceSpace(TransformSpace value) => sourceSpaceValue = value.index; - - @override - void destSpaceValueChanged(int from, int to) => markConstraintDirty(); - - @override - void sourceSpaceValueChanged(int from, int to) => markConstraintDirty(); - @override void constrain(TransformComponent component) { if (target == null) { diff --git a/lib/src/rive_core/constraints/transform_space_constraint.dart b/lib/src/rive_core/constraints/transform_space_constraint.dart new file mode 100644 index 0000000..bc74a44 --- /dev/null +++ b/lib/src/rive_core/constraints/transform_space_constraint.dart @@ -0,0 +1,21 @@ +import 'package:rive/src/rive_core/math/transform_components.dart'; +import 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; +import 'package:rive/src/rive_core/transform_space.dart'; +export 'package:rive/src/generated/constraints/transform_space_constraint_base.dart'; + +abstract class TransformSpaceConstraint extends TransformSpaceConstraintBase { + final TransformComponents componentsA = TransformComponents(); + final TransformComponents componentsB = TransformComponents(); + + TransformSpace get destSpace => TransformSpace.values[destSpaceValue]; + set destSpace(TransformSpace value) => destSpaceValue = value.index; + + TransformSpace get sourceSpace => TransformSpace.values[sourceSpaceValue]; + set sourceSpace(TransformSpace value) => sourceSpaceValue = value.index; + + @override + void destSpaceValueChanged(int from, int to) => markConstraintDirty(); + + @override + void sourceSpaceValueChanged(int from, int to) => markConstraintDirty(); +} diff --git a/lib/src/rive_core/constraints/translation_constraint.dart b/lib/src/rive_core/constraints/translation_constraint.dart new file mode 100644 index 0000000..ffde868 --- /dev/null +++ b/lib/src/rive_core/constraints/translation_constraint.dart @@ -0,0 +1,93 @@ +import 'package:rive/src/rive_core/constraints/constraint.dart'; +import 'package:rive/src/rive_core/math/mat2d.dart'; +import 'package:rive/src/rive_core/math/vec2d.dart'; +import 'package:rive/src/generated/constraints/translation_constraint_base.dart'; +import 'package:rive/src/rive_core/transform_component.dart'; +import 'package:rive/src/rive_core/transform_space.dart'; +export 'package:rive/src/generated/constraints/translation_constraint_base.dart'; + +/// A constraint copies the translation from the target component to the +/// constrained component in world or local space and applies copy/min/max +/// rules. +class TranslationConstraint extends TranslationConstraintBase { + @override + void constrain(TransformComponent component) { + var transformA = component.worldTransform; + var translationA = Vec2D.fromValues(transformA[4], transformA[5]); + var translationB = Vec2D(); + if (target == null) { + Vec2D.copy(translationB, translationA); + } else { + var transformB = Mat2D.clone(target!.worldTransform); + if (sourceSpace == TransformSpace.local) { + var inverse = Mat2D(); + if (!Mat2D.invert(inverse, parentWorld(target!))) { + return; + } + Mat2D.multiply(transformB, inverse, transformB); + } + translationB[0] = transformB[4]; + translationB[1] = transformB[5]; + + if (!doesCopy) { + translationB[0] = + destSpace == TransformSpace.local ? 0 : translationA[0]; + } else { + translationB[0] *= copyFactor; + if (offset) { + translationB[0] += component.x; + } + } + + if (!doesCopyY) { + translationB[1] = + destSpace == TransformSpace.local ? 0 : translationA[1]; + } else { + translationB[1] *= copyFactorY; + + if (offset) { + translationB[1] += component.y; + } + } + + if (destSpace == TransformSpace.local) { + // Destination space is in parent transform coordinates. + Vec2D.transformMat2D( + translationB, translationB, parentWorld(component)); + } + } + + bool clampLocal = minMaxSpace == TransformSpace.local; + if (clampLocal) { + // Apply min max in local space, so transform to local coordinates first. + var invert = Mat2D(); + if (!Mat2D.invert(invert, parentWorld(component))) { + return; + } + // Get our target world coordinates in parent local. + Vec2D.transformMat2D(translationB, translationB, invert); + } + if (max && translationB[0] > maxValue) { + translationB[0] = maxValue; + } + if (min && translationB[0] < minValue) { + translationB[0] = minValue; + } + if (maxY && translationB[1] > maxValueY) { + translationB[1] = maxValueY; + } + if (minY && translationB[1] < minValueY) { + translationB[1] = minValueY; + } + if (clampLocal) { + // Transform back to world. + Vec2D.transformMat2D(translationB, translationB, parentWorld(component)); + } + + var ti = 1 - strength; + + // Just interpolate world translation + transformA[4] = translationA[0] * ti + translationB[0] * strength; + transformA[5] = translationA[1] * ti + translationB[1] * strength; + } +} diff --git a/lib/src/rive_core/transform_component.dart b/lib/src/rive_core/transform_component.dart index c570fef..579b748 100644 --- a/lib/src/rive_core/transform_component.dart +++ b/lib/src/rive_core/transform_component.dart @@ -3,7 +3,10 @@ import 'package:rive/src/rive_core/component.dart'; import 'package:rive/src/rive_core/component_dirt.dart'; import 'package:rive/src/rive_core/constraints/constraint.dart'; import 'package:rive/src/rive_core/constraints/ik_constraint.dart'; +import 'package:rive/src/rive_core/constraints/rotation_constraint.dart'; +import 'package:rive/src/rive_core/constraints/scale_constraint.dart'; import 'package:rive/src/rive_core/constraints/transform_constraint.dart'; +import 'package:rive/src/rive_core/constraints/translation_constraint.dart'; import 'package:rive/src/rive_core/container_component.dart'; import 'package:rive/src/rive_core/draw_rules.dart'; import 'package:rive/src/rive_core/drawable.dart'; @@ -169,6 +172,9 @@ abstract class TransformComponent extends TransformComponentBase { case TransformConstraintBase.typeKey: case IKConstraintBase.typeKey: case DistanceConstraintBase.typeKey: + case TranslationConstraintBase.typeKey: + case RotationConstraintBase.typeKey: + case ScaleConstraintBase.typeKey: _constraints.add(child as Constraint); break; }