From 452294cf84b5c366daafef91fdf260731949207c Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 25 Apr 2023 18:43:32 +0200 Subject: [PATCH] Fix CanvasEffect not invalidation on creation request --- src/ComputeSharp.D2D1.UI/CanvasEffect.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ComputeSharp.D2D1.UI/CanvasEffect.cs b/src/ComputeSharp.D2D1.UI/CanvasEffect.cs index efef99d5..898aa459 100644 --- a/src/ComputeSharp.D2D1.UI/CanvasEffect.cs +++ b/src/ComputeSharp.D2D1.UI/CanvasEffect.cs @@ -124,14 +124,12 @@ public abstract partial class CanvasEffect : ICanvasImage, ICanvasImageInterop.I this.canvasImage?.Dispose(); this.canvasImage = null; - this.isInvalidated = false; - } - else - { - // Otherwise, just mark the internal state as not being valid anymore. The next - // time the image is requested, the effect graph will be configured if needed. - this.isInvalidated = true; } + + // For both invalidation types, always mark the internal state as not being valid anymore. + // The next time the image is requested, the effect graph will be configured if needed. + // This matches the default value for the field (which is needed for the first realization). + this.isInvalidated = true; } }