mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-27 02:07:12 +08:00
Getting state machine and bones working with nnbd.
This commit is contained in:
@ -27,8 +27,7 @@ class StateMachineLayerImporter extends ImportStackObject {
|
||||
int artboardAnimationIndex = state.animationId;
|
||||
assert(artboardAnimationIndex >= 0 &&
|
||||
artboardAnimationIndex < artboardImporter.animations.length);
|
||||
state.animationId =
|
||||
artboardImporter.animations[artboardAnimationIndex].id;
|
||||
state.animation = artboardImporter.animations[artboardAnimationIndex];
|
||||
}
|
||||
for (final transition in state.transitions) {
|
||||
// At import time the stateToId is an index relative to the entire layer
|
||||
|
@ -23,12 +23,4 @@ class AnimationState extends AnimationStateBase {
|
||||
void animationIdChanged(int from, int to) {
|
||||
animation = id == Core.missingId ? null : context.resolve(to);
|
||||
}
|
||||
|
||||
@override
|
||||
void onAddedDirty() {
|
||||
super.onAddedDirty();
|
||||
if (animationId != Core.missingId) {
|
||||
animation = context.resolve(animationId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,12 @@ class Skin extends SkinBase {
|
||||
(parent as Skinnable).addSkin(this);
|
||||
parent!.markRebuildDependencies();
|
||||
}
|
||||
_worldTransform[0] = xx;
|
||||
_worldTransform[1] = xy;
|
||||
_worldTransform[2] = yx;
|
||||
_worldTransform[3] = yy;
|
||||
_worldTransform[4] = tx;
|
||||
_worldTransform[5] = ty;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -5,7 +5,7 @@ export 'package:rive/src/generated/bones/tendon_base.dart';
|
||||
|
||||
class Tendon extends TendonBase {
|
||||
final Mat2D _bind = Mat2D();
|
||||
Mat2D? _inverseBind = Mat2D();
|
||||
Mat2D? _inverseBind;
|
||||
SkeletalComponent _bone = SkeletalComponent.unknown;
|
||||
SkeletalComponent get bone => _bone;
|
||||
Mat2D get inverseBind {
|
||||
@ -22,6 +22,12 @@ class Tendon extends TendonBase {
|
||||
void onAddedDirty() {
|
||||
super.onAddedDirty();
|
||||
_bone = context.resolveWithDefault(boneId, SkeletalComponent.unknown);
|
||||
_bind[0] = xx;
|
||||
_bind[1] = xy;
|
||||
_bind[2] = yx;
|
||||
_bind[3] = yy;
|
||||
_bind[4] = tx;
|
||||
_bind[5] = ty;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -6,8 +6,6 @@ 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';
|
||||
|
||||
enum PointsPathEditMode { off, creating, editing }
|
||||
|
||||
class PointsPath extends PointsPathBase with Skinnable {
|
||||
final List<PathVertex> _vertices = [];
|
||||
PointsPath() {
|
||||
|
Reference in New Issue
Block a user