diff --git a/.rive_head b/.rive_head index 3b930e3..007eddf 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -2bc4acfbae514b00af797f08e28e35bad6fb76c3 +011f9ab5813d3a8159731d9eb11a70d1afb025d3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a80b22..169aa6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ +## 0.10.4 + +- Support for Solos. + ## 0.10.3 -- Fixes animations with negative speed to play from the end with ping pong and one shot animations. -- Update runtime to consider speed on animation states when playing state machines. -- Fix edge case with spilled time, by clearing spilled time after an advance cycle. +- Fixes animations with negative speed to play from the end with ping pong and one shot animations. +- Update runtime to consider speed on animation states when playing state machines. +- Fix edge case with spilled time, by clearing spilled time after an advance cycle. ## 0.10.2 diff --git a/lib/src/rive_core/container_component.dart b/lib/src/rive_core/container_component.dart index 49be6f6..ca936b6 100644 --- a/lib/src/rive_core/container_component.dart +++ b/lib/src/rive_core/container_component.dart @@ -23,7 +23,7 @@ abstract class ContainerComponent extends ContainerComponentBase { @mustCallSuper void childAdded(Component child) { - _propagateCollapseToChildren(isCollapsed); + propagateCollapseToChildren(isCollapsed); } void childRemoved(Component child) {} @@ -74,7 +74,8 @@ abstract class ContainerComponent extends ContainerComponentBase { } } - void _propagateCollapseToChildren(bool collapse) { + @protected + void propagateCollapseToChildren(bool collapse) { for (final child in children) { child.propagateCollapse(collapse); } @@ -85,7 +86,7 @@ abstract class ContainerComponent extends ContainerComponentBase { if (!super.propagateCollapse(collapse)) { return false; } - _propagateCollapseToChildren(collapse); + propagateCollapseToChildren(collapse); return true; } } diff --git a/lib/src/rive_core/solo.dart b/lib/src/rive_core/solo.dart index a78e071..fef0b94 100644 --- a/lib/src/rive_core/solo.dart +++ b/lib/src/rive_core/solo.dart @@ -18,29 +18,26 @@ class Solo extends SoloBase { } _activeComponent = value; activeComponentId = value?.id ?? Core.missingId; - _updateCollapse(); + propagateCollapseToChildren(isCollapsed); } - void _updateCollapse() { + @override + void propagateCollapseToChildren(bool collapse) { for (final child in children) { - if (child == _activeComponent) { - child.propagateCollapse(false); - } else { - child.propagateCollapse(true); - } + child.propagateCollapse(collapse || child != _activeComponent); } } @override void childRemoved(Component child) { super.childRemoved(child); - _updateCollapse(); + propagateCollapseToChildren(isCollapsed); } @override void childAdded(Component child) { super.childAdded(child); - _updateCollapse(); + propagateCollapseToChildren(isCollapsed); } @override @@ -50,4 +47,10 @@ class Solo extends SoloBase { activeComponent = context.resolve(activeComponentId); } } + + @override + void onAdded() { + super.onAdded(); + propagateCollapseToChildren(isCollapsed); + } } diff --git a/pubspec.yaml b/pubspec.yaml index 7c28a81..c46b781 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: rive -version: 0.10.3 +version: 0.10.4 homepage: https://rive.app description: Rive 2 Flutter Runtime. This package provides runtime functionality for playing back and interacting with animations built with the Rive editor available at https://rive.app. repository: https://github.com/rive-app/rive-flutter