mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-25 17:11:55 +08:00
Adding distance constraint.
This commit is contained in:
77
lib/src/generated/constraints/distance_constraint_base.dart
Normal file
77
lib/src/generated/constraints/distance_constraint_base.dart
Normal file
@ -0,0 +1,77 @@
|
||||
/// Core automatically generated
|
||||
/// lib/src/generated/constraints/distance_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 DistanceConstraintBase extends TargetedConstraint {
|
||||
static const int typeKey = 82;
|
||||
@override
|
||||
int get coreType => DistanceConstraintBase.typeKey;
|
||||
@override
|
||||
Set<int> get coreTypes => {
|
||||
DistanceConstraintBase.typeKey,
|
||||
TargetedConstraintBase.typeKey,
|
||||
ConstraintBase.typeKey,
|
||||
ComponentBase.typeKey
|
||||
};
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// Distance field with key 177.
|
||||
static const double distanceInitialValue = 100.0;
|
||||
double _distance = distanceInitialValue;
|
||||
static const int distancePropertyKey = 177;
|
||||
|
||||
/// The unit distance the constraint will move the constrained object relative
|
||||
/// to the target.
|
||||
double get distance => _distance;
|
||||
|
||||
/// Change the [_distance] field value.
|
||||
/// [distanceChanged] will be invoked only if the field's value has changed.
|
||||
set distance(double value) {
|
||||
if (_distance == value) {
|
||||
return;
|
||||
}
|
||||
double from = _distance;
|
||||
_distance = value;
|
||||
if (hasValidated) {
|
||||
distanceChanged(from, value);
|
||||
}
|
||||
}
|
||||
|
||||
void distanceChanged(double from, double to);
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// ModeValue field with key 178.
|
||||
static const int modeValueInitialValue = 0;
|
||||
int _modeValue = modeValueInitialValue;
|
||||
static const int modeValuePropertyKey = 178;
|
||||
|
||||
/// Backing value for the mode enum.
|
||||
int get modeValue => _modeValue;
|
||||
|
||||
/// Change the [_modeValue] field value.
|
||||
/// [modeValueChanged] will be invoked only if the field's value has changed.
|
||||
set modeValue(int value) {
|
||||
if (_modeValue == value) {
|
||||
return;
|
||||
}
|
||||
int from = _modeValue;
|
||||
_modeValue = value;
|
||||
if (hasValidated) {
|
||||
modeValueChanged(from, value);
|
||||
}
|
||||
}
|
||||
|
||||
void modeValueChanged(int from, int to);
|
||||
|
||||
@override
|
||||
void copy(DistanceConstraintBase source) {
|
||||
super.copy(source);
|
||||
_distance = source._distance;
|
||||
_modeValue = source._modeValue;
|
||||
}
|
||||
}
|
@ -46,6 +46,7 @@ import 'package:rive/src/generated/bones/tendon_base.dart';
|
||||
import 'package:rive/src/generated/bones/weight_base.dart';
|
||||
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/targeted_constraint_base.dart';
|
||||
import 'package:rive/src/generated/draw_rules_base.dart';
|
||||
@ -110,6 +111,7 @@ import 'package:rive/src/rive_core/bones/root_bone.dart';
|
||||
import 'package:rive/src/rive_core/bones/skin.dart';
|
||||
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/draw_rules.dart';
|
||||
import 'package:rive/src/rive_core/draw_target.dart';
|
||||
@ -140,6 +142,8 @@ class RiveCoreContext {
|
||||
switch (typeKey) {
|
||||
case DrawTargetBase.typeKey:
|
||||
return DrawTarget();
|
||||
case DistanceConstraintBase.typeKey:
|
||||
return DistanceConstraint();
|
||||
case IKConstraintBase.typeKey:
|
||||
return IKConstraint();
|
||||
case AnimationStateBase.typeKey:
|
||||
@ -289,6 +293,16 @@ class RiveCoreContext {
|
||||
object.targetId = value;
|
||||
}
|
||||
break;
|
||||
case DistanceConstraintBase.distancePropertyKey:
|
||||
if (object is DistanceConstraintBase && value is double) {
|
||||
object.distance = value;
|
||||
}
|
||||
break;
|
||||
case DistanceConstraintBase.modeValuePropertyKey:
|
||||
if (object is DistanceConstraintBase && value is int) {
|
||||
object.modeValue = value;
|
||||
}
|
||||
break;
|
||||
case IKConstraintBase.invertDirectionPropertyKey:
|
||||
if (object is IKConstraintBase && value is bool) {
|
||||
object.invertDirection = value;
|
||||
@ -917,6 +931,7 @@ class RiveCoreContext {
|
||||
case DrawTargetBase.drawableIdPropertyKey:
|
||||
case DrawTargetBase.placementValuePropertyKey:
|
||||
case TargetedConstraintBase.targetIdPropertyKey:
|
||||
case DistanceConstraintBase.modeValuePropertyKey:
|
||||
case IKConstraintBase.parentBoneCountPropertyKey:
|
||||
case AnimationStateBase.animationIdPropertyKey:
|
||||
case KeyedObjectBase.objectIdPropertyKey:
|
||||
@ -960,6 +975,7 @@ class RiveCoreContext {
|
||||
case TendonBase.boneIdPropertyKey:
|
||||
return uintType;
|
||||
case ConstraintBase.strengthPropertyKey:
|
||||
case DistanceConstraintBase.distancePropertyKey:
|
||||
case StateMachineNumberBase.valuePropertyKey:
|
||||
case TransitionNumberConditionBase.valuePropertyKey:
|
||||
case CubicInterpolatorBase.x1PropertyKey:
|
||||
@ -1069,6 +1085,8 @@ class RiveCoreContext {
|
||||
return (object as DrawTargetBase).placementValue;
|
||||
case TargetedConstraintBase.targetIdPropertyKey:
|
||||
return (object as TargetedConstraintBase).targetId;
|
||||
case DistanceConstraintBase.modeValuePropertyKey:
|
||||
return (object as DistanceConstraintBase).modeValue;
|
||||
case IKConstraintBase.parentBoneCountPropertyKey:
|
||||
return (object as IKConstraintBase).parentBoneCount;
|
||||
case AnimationStateBase.animationIdPropertyKey:
|
||||
@ -1159,6 +1177,8 @@ class RiveCoreContext {
|
||||
switch (propertyKey) {
|
||||
case ConstraintBase.strengthPropertyKey:
|
||||
return (object as ConstraintBase).strength;
|
||||
case DistanceConstraintBase.distancePropertyKey:
|
||||
return (object as DistanceConstraintBase).distance;
|
||||
case StateMachineNumberBase.valuePropertyKey:
|
||||
return (object as StateMachineNumberBase).value;
|
||||
case TransitionNumberConditionBase.valuePropertyKey:
|
||||
@ -1375,6 +1395,11 @@ class RiveCoreContext {
|
||||
object.targetId = value;
|
||||
}
|
||||
break;
|
||||
case DistanceConstraintBase.modeValuePropertyKey:
|
||||
if (object is DistanceConstraintBase) {
|
||||
object.modeValue = value;
|
||||
}
|
||||
break;
|
||||
case IKConstraintBase.parentBoneCountPropertyKey:
|
||||
if (object is IKConstraintBase) {
|
||||
object.parentBoneCount = value;
|
||||
@ -1590,6 +1615,11 @@ class RiveCoreContext {
|
||||
object.strength = value;
|
||||
}
|
||||
break;
|
||||
case DistanceConstraintBase.distancePropertyKey:
|
||||
if (object is DistanceConstraintBase) {
|
||||
object.distance = value;
|
||||
}
|
||||
break;
|
||||
case StateMachineNumberBase.valuePropertyKey:
|
||||
if (object is StateMachineNumberBase) {
|
||||
object.value = value;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/animation_base.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/animation_base.dart';
|
||||
export 'package:rive/src/generated/animation/animation_base.dart';
|
||||
|
||||
class Animation extends AnimationBase<RuntimeArtboard> {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/animation_state_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/animation_state_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/linear_animation.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/animation_state_base.dart';
|
||||
export 'package:rive/src/generated/animation/animation_state_base.dart';
|
||||
|
||||
class AnimationState extends AnimationStateBase {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:rive/src/generated/animation/any_state_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/any_state_base.dart';
|
||||
export 'package:rive/src/generated/animation/any_state_base.dart';
|
||||
|
||||
class AnyState extends AnyStateBase {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/blend_animation_base.dart';
|
||||
import 'package:rive/src/generated/artboard_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/layer_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/linear_animation.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/blend_animation_base.dart';
|
||||
import 'package:rive/src/generated/artboard_base.dart';
|
||||
export 'package:rive/src/generated/animation/blend_animation_base.dart';
|
||||
|
||||
abstract class BlendAnimation extends BlendAnimationBase {
|
||||
|
@ -1,8 +1,7 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/blend_animation_direct_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_number.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/blend_animation_direct_base.dart';
|
||||
export 'package:rive/src/generated/animation/blend_animation_direct_base.dart';
|
||||
|
||||
class BlendAnimationDirect extends BlendAnimationDirectBase {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/blend_state_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_animation.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/blend_state_base.dart';
|
||||
export 'package:rive/src/generated/animation/blend_state_base.dart';
|
||||
|
||||
//
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/blend_state_1d_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_state_1d_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_number.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/blend_state_1d_base.dart';
|
||||
export 'package:rive/src/generated/animation/blend_state_1d_base.dart';
|
||||
|
||||
class BlendState1D extends BlendState1DBase {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:rive/src/generated/animation/blend_state_direct_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_state_direct_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
import 'package:rive/src/generated/animation/blend_state_direct_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/animation/blend_state_direct_base.dart';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_animation.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/linear_animation_instance.dart';
|
||||
|
@ -1,11 +1,10 @@
|
||||
import 'package:rive/src/generated/animation/blend_state_transition_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_animation.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_state_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/layer_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/linear_animation.dart';
|
||||
import 'package:rive/src/rive_core/animation/linear_animation_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/blend_state_transition_base.dart';
|
||||
export 'package:rive/src/generated/animation/blend_state_transition_base.dart';
|
||||
|
||||
class BlendStateTransition extends BlendStateTransitionBase {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/cubic_interpolator_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/interpolator.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
import 'package:rive/src/generated/animation/cubic_interpolator_base.dart';
|
||||
|
||||
const int newtonIterations = 4;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:rive/src/generated/animation/entry_state_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/entry_state_base.dart';
|
||||
export 'package:rive/src/generated/animation/entry_state_base.dart';
|
||||
|
||||
class EntryState extends EntryStateBase {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:rive/src/generated/animation/exit_state_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/exit_state_base.dart';
|
||||
export 'package:rive/src/generated/animation/exit_state_base.dart';
|
||||
|
||||
class ExitState extends ExitStateBase {
|
||||
|
@ -1,12 +1,11 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/keyed_object_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/keyed_property.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/keyed_object_base.dart';
|
||||
import 'linear_animation.dart';
|
||||
|
||||
export 'package:rive/src/generated/animation/keyed_object_base.dart';
|
||||
|
||||
class KeyedObject extends KeyedObjectBase<RuntimeArtboard> {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/keyed_property_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/keyed_object.dart';
|
||||
import 'package:rive/src/rive_core/animation/keyframe.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/keyed_property_base.dart';
|
||||
export 'package:rive/src/generated/animation/keyed_property_base.dart';
|
||||
|
||||
abstract class KeyFrameInterface {
|
||||
|
@ -1,10 +1,11 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/keyframe_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/interpolator.dart';
|
||||
import 'package:rive/src/rive_core/animation/keyed_property.dart';
|
||||
import 'package:rive/src/rive_core/animation/keyframe_interpolation.dart';
|
||||
import 'package:rive/src/rive_core/animation/linear_animation.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/keyframe_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/animation/keyframe_base.dart';
|
||||
|
||||
abstract class KeyFrame extends KeyFrameBase<RuntimeArtboard>
|
||||
|
@ -1,9 +1,8 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/layer_state_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_layer.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_transition.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/layer_state_base.dart';
|
||||
export 'package:rive/src/generated/animation/layer_state_base.dart';
|
||||
|
||||
abstract class LayerState extends LayerStateBase {
|
||||
|
@ -1,11 +1,10 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/linear_animation_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/keyed_object.dart';
|
||||
import 'package:rive/src/rive_core/animation/loop.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/linear_animation_base.dart';
|
||||
export 'package:rive/src/generated/animation/linear_animation_base.dart';
|
||||
|
||||
class LinearAnimation extends LinearAnimationBase {
|
||||
|
@ -1,9 +1,8 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/state_machine_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_input.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_layer.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/state_machine_base.dart';
|
||||
export 'package:rive/src/generated/animation/state_machine_base.dart';
|
||||
|
||||
class StateMachine extends StateMachineBase {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/state_machine_component_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine.dart';
|
||||
import 'package:rive/src/generated/animation/state_machine_component_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/animation/state_machine_component_base.dart';
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/generated/animation/state_machine_input_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_component.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/state_machine_input_base.dart';
|
||||
export 'package:rive/src/generated/animation/state_machine_input_base.dart';
|
||||
|
||||
abstract class StateMachineInput extends StateMachineInputBase {
|
||||
|
@ -1,14 +1,13 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/generated/animation/any_state_base.dart';
|
||||
import 'package:rive/src/generated/animation/state_machine_layer_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/any_state.dart';
|
||||
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/layer_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_component.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/any_state_base.dart';
|
||||
import 'package:rive/src/generated/animation/state_machine_layer_base.dart';
|
||||
export 'package:rive/src/generated/animation/state_machine_layer_base.dart';
|
||||
|
||||
class StateMachineLayer extends StateMachineLayerBase {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/state_transition_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/animation_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/animation_state_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/layer_state.dart';
|
||||
@ -11,8 +10,8 @@ import 'package:rive/src/rive_core/animation/loop.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/transition_condition.dart';
|
||||
import 'package:rive/src/rive_core/animation/transition_trigger_condition.dart';
|
||||
import 'package:rive/src/generated/animation/state_transition_base.dart';
|
||||
import 'package:rive/src/rive_core/state_transition_flags.dart';
|
||||
|
||||
export 'package:rive/src/generated/animation/state_transition_base.dart';
|
||||
|
||||
enum AllowTransition { no, waitingForExit, yes }
|
||||
|
@ -1,9 +1,7 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/generated/animation/transition_bool_condition_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_bool.dart';
|
||||
import 'package:rive/src/rive_core/animation/transition_condition.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/transition_bool_condition_base.dart';
|
||||
export 'package:rive/src/generated/animation/transition_bool_condition_base.dart';
|
||||
|
||||
class TransitionBoolCondition extends TransitionBoolConditionBase {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/animation/transition_condition_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_input.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_transition.dart';
|
||||
import 'package:rive/src/generated/animation/transition_condition_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/animation/transition_condition_base.dart';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/generated/animation/transition_number_condition_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_number.dart';
|
||||
import 'package:rive/src/rive_core/animation/transition_condition.dart';
|
||||
import 'package:rive/src/generated/animation/transition_number_condition_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/animation/transition_number_condition_base.dart';
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/generated/animation/transition_trigger_condition_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine_trigger.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/transition_trigger_condition_base.dart';
|
||||
export 'package:rive/src/generated/animation/transition_trigger_condition_base.dart';
|
||||
|
||||
class TransitionTriggerCondition extends TransitionTriggerConditionBase {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:rive/src/generated/animation/transition_value_condition_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/transition_condition.dart';
|
||||
|
||||
import 'package:rive/src/generated/animation/transition_value_condition_base.dart';
|
||||
export 'package:rive/src/generated/animation/transition_value_condition_base.dart';
|
||||
|
||||
abstract class TransitionValueCondition extends TransitionValueConditionBase {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/artboard_base.dart';
|
||||
import 'package:rive/src/rive_core/animation/animation.dart';
|
||||
import 'package:rive/src/rive_core/animation/linear_animation.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_machine.dart';
|
||||
@ -15,6 +14,7 @@ import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
import 'package:rive/src/rive_core/rive_animation_controller.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
||||
import 'package:rive/src/generated/artboard_base.dart';
|
||||
import 'package:rive/src/utilities/dependency_sorter.dart';
|
||||
|
||||
export 'package:rive/src/generated/artboard_base.dart';
|
||||
@ -129,7 +129,10 @@ class Artboard extends ArtboardBase with ShapePaintContainer {
|
||||
didUpdate = true;
|
||||
}
|
||||
}
|
||||
return updateComponents() || didUpdate;
|
||||
if (updateComponents() || didUpdate) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:rive/src/generated/bones/bone_base.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/bones/bone_base.dart';
|
||||
export 'package:rive/src/generated/bones/bone_base.dart';
|
||||
|
||||
typedef bool BoneCallback(Bone bone);
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:rive/src/generated/bones/cubic_weight_base.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/bones/cubic_weight_base.dart';
|
||||
export 'package:rive/src/generated/bones/cubic_weight_base.dart';
|
||||
|
||||
class CubicWeight extends CubicWeightBase {
|
||||
|
@ -1,11 +1,11 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:rive/src/generated/bones/skin_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/skinnable.dart';
|
||||
import 'package:rive/src/rive_core/bones/tendon.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/generated/bones/skin_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/bones/skin_base.dart';
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:rive/src/generated/bones/tendon_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/skeletal_component.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/bones/tendon_base.dart';
|
||||
export 'package:rive/src/generated/bones/tendon_base.dart';
|
||||
|
||||
class Tendon extends TendonBase {
|
||||
|
@ -1,9 +1,8 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:rive/src/generated/bones/weight_base.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/bones/weight_base.dart';
|
||||
export 'package:rive/src/generated/bones/weight_base.dart';
|
||||
|
||||
class Weight extends WeightBase {
|
||||
|
@ -1,11 +1,11 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/component_base.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
import 'package:rive/src/rive_core/container_component.dart';
|
||||
|
||||
import 'package:rive/src/generated/component_base.dart';
|
||||
import 'package:rive/src/utilities/dependency_sorter.dart';
|
||||
import 'package:rive/src/utilities/tops.dart';
|
||||
|
||||
export 'package:rive/src/generated/component_base.dart';
|
||||
|
||||
abstract class Component extends ComponentBase<RuntimeArtboard>
|
||||
|
@ -6,21 +6,27 @@ export 'package:rive/src/generated/constraints/constraint_base.dart';
|
||||
/// providing rules for how to constrain its transform space.
|
||||
abstract class Constraint extends ConstraintBase {
|
||||
/// Returns the [TransformComponent] which this [Constraint] is applied to.
|
||||
// TransformComponent? get constrainedComponent =>
|
||||
// parent is TransformComponent ? parent as TransformComponent : null;
|
||||
TransformComponent get constrainedComponent => parent as TransformComponent;
|
||||
TransformComponent? get constrainedComponent =>
|
||||
parent is TransformComponent ? parent as TransformComponent : null;
|
||||
|
||||
@override
|
||||
void strengthChanged(double from, double to) =>
|
||||
constrainedComponent.markTransformDirty();
|
||||
constrainedComponent?.markTransformDirty();
|
||||
|
||||
@override
|
||||
bool validate() => super.validate() && parent is TransformComponent;
|
||||
|
||||
void constrain(TransformComponent component);
|
||||
|
||||
@override
|
||||
void buildDependencies() {
|
||||
super.buildDependencies();
|
||||
|
||||
parent!.addDependent(this);
|
||||
}
|
||||
|
||||
@override
|
||||
void update(int dirt) {}
|
||||
|
||||
void markConstraintDirty() => constrainedComponent.markTransformDirty();
|
||||
void markConstraintDirty() => constrainedComponent?.markTransformDirty();
|
||||
}
|
||||
|
63
lib/src/rive_core/constraints/distance_constraint.dart
Normal file
63
lib/src/rive_core/constraints/distance_constraint.dart
Normal file
@ -0,0 +1,63 @@
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
import 'package:rive/src/generated/constraints/distance_constraint_base.dart';
|
||||
import 'package:rive/src/rive_core/transform_component.dart';
|
||||
export 'package:rive/src/generated/constraints/distance_constraint_base.dart';
|
||||
|
||||
enum DistanceConstraintMode { closer, further, exact }
|
||||
|
||||
const _distanceEpsilon = 0.001;
|
||||
|
||||
/// A constraint which transaltes its constrained component in world space to a
|
||||
/// certain distance from the [target] based on [mode].
|
||||
class DistanceConstraint extends DistanceConstraintBase {
|
||||
@override
|
||||
void constrain(TransformComponent component) {
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
var targetTranslation = target!.worldTranslation;
|
||||
var ourTranslation = component.worldTranslation;
|
||||
|
||||
var toTarget = Vec2D.subtract(Vec2D(), ourTranslation, targetTranslation);
|
||||
var currentDistance = Vec2D.length(toTarget);
|
||||
switch (mode) {
|
||||
case DistanceConstraintMode.closer:
|
||||
if (currentDistance < distance) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case DistanceConstraintMode.further:
|
||||
if (currentDistance > distance) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case DistanceConstraintMode.exact:
|
||||
break;
|
||||
}
|
||||
if (currentDistance < _distanceEpsilon) {
|
||||
return;
|
||||
}
|
||||
|
||||
Vec2D.scale(toTarget, toTarget, 1.0 / currentDistance);
|
||||
Vec2D.scale(toTarget, toTarget, distance);
|
||||
|
||||
var world = component.worldTransform;
|
||||
|
||||
var position = Vec2D.add(Vec2D(), targetTranslation, toTarget);
|
||||
Vec2D.lerp(position, ourTranslation, position, strength);
|
||||
world[4] = position[0];
|
||||
world[5] = position[1];
|
||||
}
|
||||
|
||||
@override
|
||||
void distanceChanged(double from, double to) => markConstraintDirty();
|
||||
|
||||
@override
|
||||
void modeValueChanged(int from, int to) => markConstraintDirty();
|
||||
|
||||
DistanceConstraintMode get mode => DistanceConstraintMode.values[modeValue];
|
||||
set mode(DistanceConstraintMode value) => modeValue = value.index;
|
||||
|
||||
@override
|
||||
bool validate() => super.validate() && parent is TransformComponent;
|
||||
}
|
@ -1,13 +1,11 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:rive/src/generated/constraints/ik_constraint_base.dart';
|
||||
import 'package:rive/src/rive_core/artboard.dart';
|
||||
import 'package:rive/src/rive_core/bones/bone.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/math/transform_components.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
import 'package:rive/src/generated/constraints/ik_constraint_base.dart';
|
||||
import 'package:rive/src/rive_core/transform_component.dart';
|
||||
|
||||
export 'package:rive/src/generated/constraints/ik_constraint_base.dart';
|
||||
|
||||
/// A constraint which rotates its constrained bone and the parentBoneCount
|
||||
@ -34,12 +32,12 @@ class IKConstraint extends IKConstraintBase {
|
||||
|
||||
/// The list of bones in FK order.
|
||||
final List<_BoneChainLink> _fkChain = [];
|
||||
Iterable<_BoneChainLink> get fkChain => _fkChain;
|
||||
|
||||
@override
|
||||
void buildDependencies() {
|
||||
super.buildDependencies();
|
||||
|
||||
parent!.addDependent(this);
|
||||
|
||||
// Rebuild the FK chain when we update dependencies.
|
||||
_fkChain.clear();
|
||||
var boneCount = parentBoneCount;
|
||||
|
@ -25,7 +25,9 @@ abstract class TargetedConstraint extends TargetedConstraintBase {
|
||||
super.buildDependencies();
|
||||
// Targeted constraints must have their constrainedComponent update after
|
||||
// the target.
|
||||
_target?.addDependent(constrainedComponent, via: this);
|
||||
if (constrainedComponent != null) {
|
||||
_target?.addDependent(constrainedComponent!, via: this);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -33,4 +35,5 @@ abstract class TargetedConstraint extends TargetedConstraintBase {
|
||||
super.onAddedDirty();
|
||||
target = context.resolve(targetId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/container_component_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/draw_rules.dart';
|
||||
import 'package:rive/src/rive_core/drawable.dart';
|
||||
import 'package:rive/src/generated/container_component_base.dart';
|
||||
|
||||
typedef bool DescentCallback(Component component);
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/draw_rules_base.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/draw_target.dart';
|
||||
|
||||
import 'package:rive/src/generated/draw_rules_base.dart';
|
||||
export 'package:rive/src/generated/draw_rules_base.dart';
|
||||
|
||||
class DrawRules extends DrawRulesBase {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/draw_target_base.dart';
|
||||
import 'package:rive/src/rive_core/drawable.dart';
|
||||
import 'package:rive/src/generated/draw_target_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/draw_target_base.dart';
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:rive/src/generated/drawable_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/component_flags.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/shapes/clipping_shape.dart';
|
||||
import 'package:rive/src/generated/drawable_base.dart';
|
||||
import 'package:rive/src/rive_core/transform_component.dart';
|
||||
|
||||
export 'package:rive/src/generated/drawable_base.dart';
|
||||
|
||||
abstract class Drawable extends DrawableBase {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:rive/src/generated/node_base.dart';
|
||||
import 'package:rive/src/rive_core/math/aabb.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/node_base.dart';
|
||||
export 'package:rive/src/generated/node_base.dart';
|
||||
|
||||
class _UnknownNode extends Node {}
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:rive/src/generated/shapes/clipping_shape_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/node.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/clipping_shape_base.dart';
|
||||
export 'package:rive/src/generated/shapes/clipping_shape_base.dart';
|
||||
|
||||
class ClippingShape extends ClippingShapeBase {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/shapes/cubic_asymmetric_vertex_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/cubic_asymmetric_vertex_base.dart';
|
||||
export 'package:rive/src/generated/shapes/cubic_asymmetric_vertex_base.dart';
|
||||
|
||||
class CubicAsymmetricVertex extends CubicAsymmetricVertexBase {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/shapes/cubic_detached_vertex_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/cubic_detached_vertex_base.dart';
|
||||
export 'package:rive/src/generated/shapes/cubic_detached_vertex_base.dart';
|
||||
|
||||
class CubicDetachedVertex extends CubicDetachedVertexBase {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/shapes/cubic_mirrored_vertex_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/cubic_mirrored_vertex_base.dart';
|
||||
export 'package:rive/src/generated/shapes/cubic_mirrored_vertex_base.dart';
|
||||
|
||||
class CubicMirroredVertex extends CubicMirroredVertexBase {
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:rive/src/generated/shapes/cubic_vertex_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/weight.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/cubic_vertex_base.dart';
|
||||
export 'package:rive/src/generated/shapes/cubic_vertex_base.dart';
|
||||
|
||||
abstract class CubicVertex extends CubicVertexBase {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:rive/src/generated/shapes/ellipse_base.dart';
|
||||
import 'package:rive/src/rive_core/math/circle_constant.dart';
|
||||
import 'package:rive/src/rive_core/shapes/cubic_detached_vertex.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/generated/shapes/ellipse_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/shapes/ellipse_base.dart';
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/fill_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/fill_base.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/fill_base.dart';
|
||||
|
||||
/// A fill Shape painter.
|
||||
|
@ -1,8 +1,8 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
||||
import 'package:rive/src/rive_core/container_component.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/linear_gradient.dart';
|
||||
import 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:rive/src/generated/shapes/paint/linear_gradient_base.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/gradient_stop.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/linear_gradient_base.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/linear_gradient_base.dart';
|
||||
|
||||
/// A core linear gradient. Can be added as a child to a [Shape]'s [Fill] or
|
||||
|
@ -1,14 +1,13 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:rive/src/generated/shapes/paint/shape_paint_base.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/container_component.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/shape_paint_base.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/shape_paint_base.dart';
|
||||
|
||||
/// Generic ShapePaint that abstracts Stroke and Fill. Automatically hooks up
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
||||
|
||||
/// A solid color painter for a shape. Works for both Fill and Stroke.
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rive/src/generated/shapes/paint/stroke_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/stroke_effect.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/stroke_base.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/stroke_base.dart';
|
||||
|
||||
/// A stroke Shape painter.
|
||||
|
@ -1,11 +1,11 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/trim_path_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/stroke.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/stroke_effect.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/trim_path_drawing.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/paint/trim_path_base.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/trim_path_base.dart';
|
||||
|
||||
enum TrimPathMode {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:rive/src/generated/shapes/parametric_path_base.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/parametric_path_base.dart';
|
||||
export 'package:rive/src/generated/shapes/parametric_path_base.dart';
|
||||
|
||||
abstract class ParametricPath extends ParametricPathBase {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'dart:math';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:rive/src/generated/shapes/path_base.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/component_flags.dart';
|
||||
@ -12,7 +11,7 @@ import 'package:rive/src/rive_core/shapes/cubic_vertex.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape.dart';
|
||||
import 'package:rive/src/rive_core/shapes/straight_vertex.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/path_base.dart';
|
||||
export 'package:rive/src/generated/shapes/path_base.dart';
|
||||
|
||||
/// An abstract low level path that gets implemented by parametric and point
|
||||
|
@ -1,12 +1,11 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:rive/src/generated/shapes/path_vertex_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/weight.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/path_vertex_base.dart';
|
||||
export 'package:rive/src/generated/shapes/path_vertex_base.dart';
|
||||
|
||||
abstract class PathVertex<T extends Weight> extends PathVertexBase {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import 'package:rive/src/generated/shapes/points_path_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/skinnable.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/generated/shapes/points_path_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/shapes/points_path_base.dart';
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:rive/src/generated/shapes/polygon_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/weight.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/rive_core/shapes/straight_vertex.dart';
|
||||
import 'package:rive/src/generated/shapes/polygon_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/shapes/polygon_base.dart';
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:rive/src/generated/shapes/rectangle_base.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/rive_core/shapes/straight_vertex.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/rectangle_base.dart';
|
||||
export 'package:rive/src/generated/shapes/rectangle_base.dart';
|
||||
|
||||
class Rectangle extends RectangleBase {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:rive/src/generated/shapes/shape_base.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/linear_gradient.dart' as core;
|
||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
||||
@ -9,6 +8,7 @@ import 'package:rive/src/rive_core/shapes/paint/stroke.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_composer.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
||||
import 'package:rive/src/generated/shapes/shape_base.dart';
|
||||
|
||||
export 'package:rive/src/generated/shapes/shape_base.dart';
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:rive/src/generated/shapes/star_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/weight.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/rive_core/shapes/straight_vertex.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/star_base.dart';
|
||||
export 'package:rive/src/generated/shapes/star_base.dart';
|
||||
|
||||
class Star extends StarBase {
|
||||
|
@ -1,9 +1,8 @@
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/generated/shapes/straight_vertex_base.dart';
|
||||
import 'package:rive/src/rive_core/bones/weight.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
|
||||
import 'package:rive/src/generated/shapes/straight_vertex_base.dart';
|
||||
export 'package:rive/src/generated/shapes/straight_vertex_base.dart';
|
||||
|
||||
class StraightVertex extends StraightVertexBase {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:rive/src/generated/shapes/triangle_base.dart';
|
||||
import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
||||
import 'package:rive/src/rive_core/shapes/straight_vertex.dart';
|
||||
import 'package:rive/src/generated/shapes/triangle_base.dart';
|
||||
|
||||
/// Export the Base class for external use (e.g. rive.dart)
|
||||
export 'package:rive/src/generated/shapes/triangle_base.dart';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:rive/src/core/core.dart';
|
||||
import 'package:rive/src/rive_core/animation/animation_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/animation_state_instance.dart';
|
||||
import 'package:rive/src/rive_core/animation/any_state.dart';
|
||||
|
@ -1,6 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:rive/src/generated/shapes/clipping_shape_base.dart';
|
||||
import 'package:rive/src/generated/transform_component_base.dart';
|
||||
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';
|
||||
@ -11,7 +9,10 @@ import 'package:rive/src/rive_core/drawable.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
import 'package:rive/src/rive_core/shapes/clipping_shape.dart';
|
||||
import 'package:rive/src/generated/shapes/clipping_shape_base.dart';
|
||||
import 'package:rive/src/generated/transform_component_base.dart';
|
||||
|
||||
import 'constraints/distance_constraint.dart';
|
||||
export 'package:rive/src/generated/transform_component_base.dart';
|
||||
|
||||
abstract class TransformComponent extends TransformComponentBase {
|
||||
@ -165,6 +166,7 @@ abstract class TransformComponent extends TransformComponentBase {
|
||||
|
||||
break;
|
||||
case IKConstraintBase.typeKey:
|
||||
case DistanceConstraintBase.typeKey:
|
||||
_constraints.add(child as Constraint);
|
||||
break;
|
||||
}
|
||||
@ -186,6 +188,7 @@ abstract class TransformComponent extends TransformComponentBase {
|
||||
}
|
||||
break;
|
||||
case IKConstraintBase.typeKey:
|
||||
case DistanceConstraintBase.typeKey:
|
||||
_constraints.remove(child as Constraint);
|
||||
|
||||
break;
|
||||
|
Reference in New Issue
Block a user