|
@@ -6,13 +6,13 @@ using PixiEditor.ChangeableDocument.Rendering;
|
|
namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Image;
|
|
namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Image;
|
|
|
|
|
|
[NodeInfo("Mask")]
|
|
[NodeInfo("Mask")]
|
|
-public class MaskNode : RenderNode, IRenderInput
|
|
|
|
|
|
+public sealed class MaskNode : RenderNode, IRenderInput
|
|
{
|
|
{
|
|
public RenderInputProperty Background { get; }
|
|
public RenderInputProperty Background { get; }
|
|
public RenderInputProperty Mask { get; }
|
|
public RenderInputProperty Mask { get; }
|
|
public InputProperty<bool> Invert { get; }
|
|
public InputProperty<bool> Invert { get; }
|
|
|
|
|
|
- protected Paint maskPaint = new()
|
|
|
|
|
|
+ private readonly Paint maskPaint = new()
|
|
{
|
|
{
|
|
BlendMode = BlendMode.DstIn,
|
|
BlendMode = BlendMode.DstIn,
|
|
ColorFilter = Filters.MaskFilter
|
|
ColorFilter = Filters.MaskFilter
|
|
@@ -52,4 +52,11 @@ public class MaskNode : RenderNode, IRenderInput
|
|
{
|
|
{
|
|
return new MaskNode();
|
|
return new MaskNode();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public override void Dispose()
|
|
|
|
+ {
|
|
|
|
+ base.Dispose();
|
|
|
|
+
|
|
|
|
+ maskPaint.Dispose();
|
|
|
|
+ }
|
|
}
|
|
}
|