mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-26 01:18:13 +08:00
Merge pull request #41 from rive-app/fix_minor_version
Fix minor version reading newer minor version.
This commit is contained in:
@ -153,8 +153,11 @@ class RiveFile {
|
|||||||
|
|
||||||
assert(!artboard.children.contains(artboard),
|
assert(!artboard.children.contains(artboard),
|
||||||
'artboard should never contain itself as a child');
|
'artboard should never contain itself as a child');
|
||||||
for (final object in artboard.objects) {
|
for (final object in artboard.objects.toList(growable:false)) {
|
||||||
object?.onAdded();
|
if(object == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
object.onAdded();
|
||||||
}
|
}
|
||||||
artboard.clean();
|
artboard.clean();
|
||||||
}
|
}
|
||||||
@ -165,7 +168,8 @@ class RiveFile {
|
|||||||
|
|
||||||
void _skipProperty(BinaryReader reader, int propertyKey,
|
void _skipProperty(BinaryReader reader, int propertyKey,
|
||||||
HashMap<int, CoreFieldType> propertyToField) {
|
HashMap<int, CoreFieldType> propertyToField) {
|
||||||
var field = propertyToField[propertyKey];
|
var field =
|
||||||
|
RiveCoreContext.coreType(propertyKey) ?? propertyToField[propertyKey];
|
||||||
if (field == null) {
|
if (field == null) {
|
||||||
throw UnsupportedError('Unsupported property key $propertyKey. '
|
throw UnsupportedError('Unsupported property key $propertyKey. '
|
||||||
'A new runtime is likely necessary to play this file.');
|
'A new runtime is likely necessary to play this file.');
|
||||||
|
@ -18,8 +18,10 @@ class RuntimeArtboard extends Artboard implements CoreContext {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
T addObject<T extends Core>(T object) {
|
T addObject<T extends Core>(T object) {
|
||||||
object.context = this;
|
if (object != null) {
|
||||||
object.id = _objects.length;
|
object.context = this;
|
||||||
|
object.id = _objects.length;
|
||||||
|
}
|
||||||
_objects.add(object);
|
_objects.add(object);
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user