Skip to content

Commit

Permalink
Fixing effect on self.
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-rosso committed Dec 2, 2019
1 parent 2375f0c commit a522dff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flare_dart/lib/actor_layer_effect_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ActorLayerEffectRenderer extends ActorDrawable {

@override
void onParentChanged(ActorNode from, ActorNode to) {
super.onParentChanged(from, to);
from?.findLayerEffect();
to?.findLayerEffect();
findEffects();
Expand Down Expand Up @@ -88,7 +89,7 @@ class ActorLayerEffectRenderer extends ActorDrawable {
// Alternative way to do this is to have each drawable check for parent
// layers when the parent changes. That would be more effective if nodes
// were to get moved around at runtime.
parent?.eachChildRecursive((node) {
parent?.all((node) {
if (node is ActorDrawable && node != this) {
node.layerEffectRenderer = this;
}
Expand All @@ -114,7 +115,8 @@ class ActorLayerEffectRenderer extends ActorDrawable {
var renderMask = ActorLayerEffectRendererMask(mask);
mask.source?.all((child) {
if (child is ActorDrawable) {
if (child.layerEffectRenderer != null) {
if (child.layerEffectRenderer != null &&
child.layerEffectRenderer != this) {
// Layer effect is direct discendant of this layer, so we want to
// draw it with the other drawables in this layer.
renderMask.drawables.add(child.layerEffectRenderer);
Expand Down

0 comments on commit a522dff

Please sign in to comment.