Profiles - Fixed folders not enabling after previous fix :)

This commit is contained in:
Robert committed 2022-11-27 15:33:05 +01:00
1 parent 6b6ea0f973
commit f30cc31ead
3 files changed
+14 -4

No files matched your search

+1 -1
View File
@@ -238,7 +238,7 @@ public sealed class Folder : RenderProfileElement
/// <inheritdoc />
public override void Enable()
{
if (!Enabled)
if (Enabled)
return;
// Not enabling children, they'll enable themselves during their own Update
+2 -3
View File
@@ -839,11 +839,10 @@ public sealed class Layer : RenderProfileElement
General.ShapeType.IsHidden = LayerBrush != null && !LayerBrush.SupportsTransformation;
General.BlendMode.IsHidden = LayerBrush != null && !LayerBrush.SupportsTransformation;
Transform.IsHidden = LayerBrush != null && !LayerBrush.SupportsTransformation;
if (LayerBrush != null)
if (LayerBrush != null && Enabled)
{
if (!LayerBrush.Enabled)
LayerBrush.InternalEnable();
LayerBrush?.Update(0);
LayerBrush.Update(0);
}
OnLayerBrushUpdated();
@@ -223,6 +223,14 @@ public abstract class RenderProfileElement : ProfileElement
// Make sure the layer effect is tied to this element
layerEffect.ProfileElement = this;
// If the element is enabled, enable the effect before adding it
if (Enabled)
{
layerEffect.InternalEnable();
layerEffect.Update(0);
}
_layerEffects.Add(layerEffect);
// Update the order on the effects
@@ -246,6 +254,9 @@ public abstract class RenderProfileElement : ProfileElement
// Remove the effect from the layer
_layerEffects.Remove(layerEffect);
// Disable the effect after removing it
layerEffect.InternalDisable();
// Update the order on the remaining effects
OrderEffects();
OnLayerEffectsUpdated();