From 6c905cdaad3102a98993564a9e6f03af9af0afb0 Mon Sep 17 00:00:00 2001 From: Luigi Rosso Date: Wed, 4 Sep 2019 08:51:45 -0700 Subject: [PATCH] Squashed commit of the following: commit 2bf6b43ca6babfcfa6915cd11972c1d6f909c159 Author: Luigi Rosso Date: Wed Sep 4 08:49:00 2019 -0700 Safety checks. commit 2c078c1d9dbf0ab6c6130d159b0664756126855d Author: Luigi Rosso Date: Wed Sep 4 08:48:35 2019 -0700 Prevent iterating null children. Fixes issue #146. commit 798ec8dfd0fbba40e0672f95ec10a0d683adb699 Author: Luigi Rosso Date: Mon Aug 26 10:40:27 2019 -0700 Updating version and changelog. commit a0b1bdbf8c8f5de54e3d9a63d2fe177c013ab549 Author: Umberto Sonnino Date: Mon Aug 26 18:07:33 2019 +0200 Clip artboard rect commit 894a97ccc6aa42f5bb7c113499f06d1aff901a18 Author: Luigi Rosso Date: Fri Aug 23 09:53:43 2019 -0700 Updating changelog and pubspec. commit ef7d75ca9440073eb2789c427877598dc756af06 Author: Umberto Sonnino Date: Thu Aug 22 19:04:04 2019 +0200 Few updates to conform with Dart style commit 4a0ce44c1463496af477e3f825b6c0819956c4f6 Author: Umberto Sonnino Date: Thu Aug 22 19:01:01 2019 +0200 Clamp paint opacity to ensure correct paint value commit 1543c33c39f26363b4317d2c22b24c323920bfb1 Author: Luigi Rosso Date: Sun Aug 4 13:38:04 2019 -0700 Adding a check for NaN numeric keyframe values. Mitigates #134. Still need to find out what Flare is exporting. commit 562ac0b644ae965b50d2b3e229c501c471ad01d1 Author: Luigi Rosso Date: Wed Jul 24 13:47:25 2019 -0700 Updating versions. commit 1e5394b37bdb08e023ebef58ccf40c89add80087 Author: Luigi Rosso Date: Wed Jul 24 11:47:01 2019 -0700 Adding artboard option. commit 6f6000f3600a3f20c7a605cf6b20df5380c88d44 Author: Luigi Rosso Date: Mon Jul 8 21:19:43 2019 -0700 Squashed commit of the following: commit f24a688baf29916ae070404fe0c656c96e5c144e Author: Luigi Rosso Date: Mon Jul 8 21:18:32 2019 -0700 Squashed commit of the following: commit 085a15c38e883149b2269eb5809c5e00b1b848b9 Author: Luigi Rosso Date: Mon Jul 8 21:17:28 2019 -0700 Squashed commit of the following: commit 56cea07339c72f7abb7dbc8354c4982157805035 Author: Luigi Rosso Date: Mon Jul 8 21:15:07 2019 -0700 Updating stable to latest flare_flutter from dev. commit 28846c58bec6cee40a23b9ab9412bd291987e0b1 Merge: e1a55f9 52d5e6e Author: Luigi Rosso Date: Sat Jul 6 11:06:01 2019 -0700 Merge pull request #121 from 2d-inc/master Merging intrinsic_size_experiment changes commit e1a55f91331e0b7cd47ec43203b594b986395523 Merge: 5533e73 15682ac Author: Luigi Rosso Date: Sat Jul 6 10:28:42 2019 -0700 Merge pull request #119 from 2d-inc/master Check for null children before iterating for initialization. commit 5533e73cbb2322a4267485c5ac13bf21f9f2da68 Merge: 01387cd a17469b Author: Luigi Rosso Date: Wed Jul 3 10:40:12 2019 -0700 Merge pull request #116 from 2d-inc/master Remove console spam. commit 01387cdb2df3c46119179feacae43f28f2b11257 Merge: 0ee2efe 525613e Author: Luigi Rosso Date: Tue Jul 2 18:13:31 2019 -0700 Merge pull request #115 from 2d-inc/master Instance shape node from actor. commit 0ee2efeb22ee2c2ecbc6a265383b337ad02768c9 Merge: 8f04aa6 0230aab Author: Luigi Rosso Date: Thu Jun 20 16:27:00 2019 -0700 Merge pull request #108 from 2d-inc/master Fixing rectangle and clips. commit 8f04aa6d355b3b5c0ed1ba515988347510cefbb6 Merge: 6606b73 865e090 Author: Luigi Rosso Date: Thu Jun 13 16:07:43 2019 -0700 Merge pull request #102 from 2d-inc/master Updating dev branch. commit 6606b73bf4f7b87105a6febfbb5f2167cf8b8977 Merge: 396cd88 f147157 Author: Luigi Rosso Date: Tue Jun 4 11:59:29 2019 -0700 Merge branch 'master' into dev commit 396cd88df7638b86e55b4467364fa2c41cde1558 Merge: 006d85b 9db2d97 Author: Luigi Rosso Date: Mon May 20 10:56:46 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 006d85bc53a61174bd2e2c2cf3321ff85312c1c7 Merge: c51192d 850ea83 Author: Luigi Rosso Date: Mon May 20 10:45:58 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit c51192dec50dec034d121f6aad7d2e8733c7e279 Merge: 4aebb0f 4e9961b Author: Luigi Rosso Date: Thu May 9 11:44:40 2019 -0700 Merge pull request #89 from 2d-inc/master Update indices to 16 bit unsigned, compatibility with flutter master. commit 4aebb0ff5b98c7bcf2183c6bac8226cc7ddf5402 Merge: 113d791 63c1d05 Author: Luigi Rosso Date: Fri Apr 26 13:42:11 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 113d791606c6b6fb7b19ca616e8b7282e4f0b610 Merge: 2ec15af 4416a67 Author: Luigi Rosso Date: Fri Apr 26 12:33:04 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 2ec15af0042696de7d997cbfdcb6deaf55463af2 Merge: d8defc4 2dbb7ab Author: Luigi Rosso Date: Wed Apr 24 12:07:45 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit d8defc4c07571ce8287f26791cf38992fffaef75 Author: Luigi Rosso Date: Wed Apr 24 10:15:51 2019 -0700 Fixing relative path for flare_dart. commit 2e1fcaaa944d4d795d21382418935b8ffa6c1615 Author: Luigi Rosso Date: Wed Apr 24 10:14:38 2019 -0700 Updating flare_dart dependency to dev branch of Flare-Flutter. commit 28846c58bec6cee40a23b9ab9412bd291987e0b1 Merge: e1a55f9 52d5e6e Author: Luigi Rosso Date: Sat Jul 6 11:06:01 2019 -0700 Merge pull request #121 from 2d-inc/master Merging intrinsic_size_experiment changes commit e1a55f91331e0b7cd47ec43203b594b986395523 Merge: 5533e73 15682ac Author: Luigi Rosso Date: Sat Jul 6 10:28:42 2019 -0700 Merge pull request #119 from 2d-inc/master Check for null children before iterating for initialization. commit 5533e73cbb2322a4267485c5ac13bf21f9f2da68 Merge: 01387cd a17469b Author: Luigi Rosso Date: Wed Jul 3 10:40:12 2019 -0700 Merge pull request #116 from 2d-inc/master Remove console spam. commit 01387cdb2df3c46119179feacae43f28f2b11257 Merge: 0ee2efe 525613e Author: Luigi Rosso Date: Tue Jul 2 18:13:31 2019 -0700 Merge pull request #115 from 2d-inc/master Instance shape node from actor. commit 0ee2efeb22ee2c2ecbc6a265383b337ad02768c9 Merge: 8f04aa6 0230aab Author: Luigi Rosso Date: Thu Jun 20 16:27:00 2019 -0700 Merge pull request #108 from 2d-inc/master Fixing rectangle and clips. commit 8f04aa6d355b3b5c0ed1ba515988347510cefbb6 Merge: 6606b73 865e090 Author: Luigi Rosso Date: Thu Jun 13 16:07:43 2019 -0700 Merge pull request #102 from 2d-inc/master Updating dev branch. commit 6606b73bf4f7b87105a6febfbb5f2167cf8b8977 Merge: 396cd88 f147157 Author: Luigi Rosso Date: Tue Jun 4 11:59:29 2019 -0700 Merge branch 'master' into dev commit 396cd88df7638b86e55b4467364fa2c41cde1558 Merge: 006d85b 9db2d97 Author: Luigi Rosso Date: Mon May 20 10:56:46 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 006d85bc53a61174bd2e2c2cf3321ff85312c1c7 Merge: c51192d 850ea83 Author: Luigi Rosso Date: Mon May 20 10:45:58 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit c51192dec50dec034d121f6aad7d2e8733c7e279 Merge: 4aebb0f 4e9961b Author: Luigi Rosso Date: Thu May 9 11:44:40 2019 -0700 Merge pull request #89 from 2d-inc/master Update indices to 16 bit unsigned, compatibility with flutter master. commit 4aebb0ff5b98c7bcf2183c6bac8226cc7ddf5402 Merge: 113d791 63c1d05 Author: Luigi Rosso Date: Fri Apr 26 13:42:11 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 113d791606c6b6fb7b19ca616e8b7282e4f0b610 Merge: 2ec15af 4416a67 Author: Luigi Rosso Date: Fri Apr 26 12:33:04 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 2ec15af0042696de7d997cbfdcb6deaf55463af2 Merge: d8defc4 2dbb7ab Author: Luigi Rosso Date: Wed Apr 24 12:07:45 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit d8defc4c07571ce8287f26791cf38992fffaef75 Author: Luigi Rosso Date: Wed Apr 24 10:15:51 2019 -0700 Fixing relative path for flare_dart. commit 2e1fcaaa944d4d795d21382418935b8ffa6c1615 Author: Luigi Rosso Date: Wed Apr 24 10:14:38 2019 -0700 Updating flare_dart dependency to dev branch of Flare-Flutter. commit 085a15c38e883149b2269eb5809c5e00b1b848b9 Author: Luigi Rosso Date: Mon Jul 8 21:17:28 2019 -0700 Squashed commit of the following: commit 56cea07339c72f7abb7dbc8354c4982157805035 Author: Luigi Rosso Date: Mon Jul 8 21:15:07 2019 -0700 Updating stable to latest flare_flutter from dev. commit 28846c58bec6cee40a23b9ab9412bd291987e0b1 Merge: e1a55f9 52d5e6e Author: Luigi Rosso Date: Sat Jul 6 11:06:01 2019 -0700 Merge pull request #121 from 2d-inc/master Merging intrinsic_size_experiment changes commit e1a55f91331e0b7cd47ec43203b594b986395523 Merge: 5533e73 15682ac Author: Luigi Rosso Date: Sat Jul 6 10:28:42 2019 -0700 Merge pull request #119 from 2d-inc/master Check for null children before iterating for initialization. commit 5533e73cbb2322a4267485c5ac13bf21f9f2da68 Merge: 01387cd a17469b Author: Luigi Rosso Date: Wed Jul 3 10:40:12 2019 -0700 Merge pull request #116 from 2d-inc/master Remove console spam. commit 01387cdb2df3c46119179feacae43f28f2b11257 Merge: 0ee2efe 525613e Author: Luigi Rosso Date: Tue Jul 2 18:13:31 2019 -0700 Merge pull request #115 from 2d-inc/master Instance shape node from actor. commit 0ee2efeb22ee2c2ecbc6a265383b337ad02768c9 Merge: 8f04aa6 0230aab Author: Luigi Rosso Date: Thu Jun 20 16:27:00 2019 -0700 Merge pull request #108 from 2d-inc/master Fixing rectangle and clips. commit 8f04aa6d355b3b5c0ed1ba515988347510cefbb6 Merge: 6606b73 865e090 Author: Luigi Rosso Date: Thu Jun 13 16:07:43 2019 -0700 Merge pull request #102 from 2d-inc/master Updating dev branch. commit 6606b73bf4f7b87105a6febfbb5f2167cf8b8977 Merge: 396cd88 f147157 Author: Luigi Rosso Date: Tue Jun 4 11:59:29 2019 -0700 Merge branch 'master' into dev commit 396cd88df7638b86e55b4467364fa2c41cde1558 Merge: 006d85b 9db2d97 Author: Luigi Rosso Date: Mon May 20 10:56:46 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 006d85bc53a61174bd2e2c2cf3321ff85312c1c7 Merge: c51192d 850ea83 Author: Luigi Rosso Date: Mon May 20 10:45:58 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit c51192dec50dec034d121f6aad7d2e8733c7e279 Merge: 4aebb0f 4e9961b Author: Luigi Rosso Date: Thu May 9 11:44:40 2019 -0700 Merge pull request #89 from 2d-inc/master Update indices to 16 bit unsigned, compatibility with flutter master. commit 4aebb0ff5b98c7bcf2183c6bac8226cc7ddf5402 Merge: 113d791 63c1d05 Author: Luigi Rosso Date: Fri Apr 26 13:42:11 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 113d791606c6b6fb7b19ca616e8b7282e4f0b610 Merge: 2ec15af 4416a67 Author: Luigi Rosso Date: Fri Apr 26 12:33:04 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit 2ec15af0042696de7d997cbfdcb6deaf55463af2 Merge: d8defc4 2dbb7ab Author: Luigi Rosso Date: Wed Apr 24 12:07:45 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter into dev commit d8defc4c07571ce8287f26791cf38992fffaef75 Author: Luigi Rosso Date: Wed Apr 24 10:15:51 2019 -0700 Fixing relative path for flare_dart. commit 2e1fcaaa944d4d795d21382418935b8ffa6c1615 Author: Luigi Rosso Date: Wed Apr 24 10:14:38 2019 -0700 Updating flare_dart dependency to dev branch of Flare-Flutter. --- flare_dart/CHANGELOG.md | 4 ++++ flare_dart/lib/actor_node.dart | 12 +++++++----- flare_dart/lib/animation/actor_animation.dart | 9 +++++---- flare_dart/pubspec.yaml | 2 +- flare_flutter/CHANGELOG.md | 4 ++++ flare_flutter/pubspec.yaml | 2 +- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/flare_dart/CHANGELOG.md b/flare_dart/CHANGELOG.md index 3d84d91..273c0f0 100644 --- a/flare_dart/CHANGELOG.md +++ b/flare_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.4.6] - 2019-09-04 08:48:11 + +- Prevent iterating null children. Fixes issue #146. + ## [1.4.5] - 2019-08-23 09:51:30 Small changes to fix warnings caught by the Dart static analyzer. diff --git a/flare_dart/lib/actor_node.dart b/flare_dart/lib/actor_node.dart index b9244d8..9b51a72 100644 --- a/flare_dart/lib/actor_node.dart +++ b/flare_dart/lib/actor_node.dart @@ -378,12 +378,14 @@ class ActorNode extends ActorComponent { return false; } - for (ActorNode child in _children) { - if (cb(child) == false) { - return false; - } + if (_children != null) { + for (final ActorNode child in _children) { + if (cb(child) == false) { + return false; + } - child.eachChildRecursive(cb); + child.eachChildRecursive(cb); + } } return true; diff --git a/flare_dart/lib/animation/actor_animation.dart b/flare_dart/lib/animation/actor_animation.dart index 5703864..7daeeac 100644 --- a/flare_dart/lib/animation/actor_animation.dart +++ b/flare_dart/lib/animation/actor_animation.dart @@ -5,7 +5,6 @@ import "../stream_reader.dart"; import "keyframe.dart"; import "property_types.dart"; - typedef KeyFrame KeyFrameReader(StreamReader reader, ActorComponent component); class PropertyAnimation { @@ -228,6 +227,7 @@ class ComponentAnimation { int numProperties = reader.readUint16Length(); componentAnimation._properties = List(numProperties); for (int i = 0; i < numProperties; i++) { + assert(componentAnimation._componentIndex < components.length); componentAnimation._properties[i] = PropertyAnimation.read( reader, components[componentAnimation._componentIndex]); } @@ -396,8 +396,8 @@ class ActorAnimation { int numKeyedComponents = reader.readUint16Length(); // We distinguish between animated and triggered components as ActorEvents - // are currently only used to trigger events and don't need the full - // animation cycle. This lets them optimize them out of the regular + // are currently only used to trigger events and don't need the full + // animation cycle. This lets them optimize them out of the regular // animation cycle. int animatedComponentCount = 0; int triggerComponentCount = 0; @@ -408,7 +408,8 @@ class ActorAnimation { ComponentAnimation componentAnimation = ComponentAnimation.read(reader, components); animatedComponents[i] = componentAnimation; - if (componentAnimation != null) { + if (componentAnimation != null && + componentAnimation.componentIndex < components.length) { ActorComponent actorComponent = components[componentAnimation.componentIndex]; if (actorComponent != null) { diff --git a/flare_dart/pubspec.yaml b/flare_dart/pubspec.yaml index bac74af..c6df821 100644 --- a/flare_dart/pubspec.yaml +++ b/flare_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: flare_dart description: Vector design and runtime animation. -version: 1.4.5 +version: 1.4.6 author: "2Dimensions Team " homepage: https://github.com/2d-inc/Flare-Flutter environment: diff --git a/flare_flutter/CHANGELOG.md b/flare_flutter/CHANGELOG.md index 20566d8..000be5e 100644 --- a/flare_flutter/CHANGELOG.md +++ b/flare_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.5.8] - 2019-09-04 08:47:31 + +- Bump flare_dart dependency version to get fix for iterating null children. Issue #146. + ## [1.5.7] - 2019-08-26 10:39:49 - Clip the artboard based on settings from Flare. diff --git a/flare_flutter/pubspec.yaml b/flare_flutter/pubspec.yaml index c2c0675..e894ce0 100644 --- a/flare_flutter/pubspec.yaml +++ b/flare_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: flare_flutter description: Vector design and runtime animation for Flutter. -version: 1.5.7 +version: 1.5.8 author: "2Dimensions Team " homepage: https://github.com/2d-inc/Flare-Flutter environment: