Treat all Constraints and ClippingShapes differently than children when propagating collapse

Decided to go with the `is` check because it seems like all types of Constraints or ClippingShapes should follow this behavior now and in the future.

Diffs=
16cf8082f Treat Constraints, ClippingShapes and DrawRules as special Solo child types (#5897)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
This commit is contained in:
philter
2023-08-25 23:50:35 +00:00
parent 7222e458c8
commit f9cc0f968a
2 changed files with 5 additions and 8 deletions

View File

@ -1 +1 @@
e1b9d360b4ab7a2620f888cb9b4497d253e1da80
16cf8082fd9a66014305994c736d98cc12d96c73

View File

@ -1,9 +1,8 @@
import 'package:rive/src/generated/solo_base.dart';
import 'package:rive/src/rive_core/component.dart';
import 'package:rive/src/rive_core/constraints/constraint.dart';
import 'package:rive/src/rive_core/container_component.dart';
import 'package:rive/src/rive_core/shapes/clipping_shape.dart';
import 'package:rive/src/generated/solo_base.dart';
export 'package:rive/src/generated/solo_base.dart';
class Solo extends SoloBase {
@ -29,11 +28,9 @@ class Solo extends SoloBase {
// as they are more aking to properties of the solo itself. For those
// components, simply pass on the collapse value of the solo itself.
for (final child in children) {
switch (child.coreType) {
case ConstraintBase.typeKey:
case ClippingShapeBase.typeKey:
child.propagateCollapse(collapse);
continue;
if (child is Constraint || child is ClippingShape) {
child.propagateCollapse(collapse);
continue;
}
// This child is part of the solo set so only make it active if it's the