Browse Source

Fixed previews disappearing

Krzysztof Krysiński 4 months ago
parent
commit
ade1aac51f

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit 7e4de2359281d40b99049748d7056f6cd836fbde
+Subproject commit 4037b56fc0accf094d10fd445f7ff93ed23131f5

+ 2 - 0
src/PixiEditor/Models/Rendering/PreviewPainter.cs

@@ -2,11 +2,13 @@
 using Avalonia.Threading;
 using Avalonia.Threading;
 using ChunkyImageLib.DataHolders;
 using ChunkyImageLib.DataHolders;
 using Drawie.Backend.Core;
 using Drawie.Backend.Core;
+using Drawie.Backend.Core.ColorsImpl;
 using Drawie.Backend.Core.Numerics;
 using Drawie.Backend.Core.Numerics;
 using PixiEditor.ChangeableDocument.Changeables.Animations;
 using PixiEditor.ChangeableDocument.Changeables.Animations;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Interfaces;
 using PixiEditor.ChangeableDocument.Changeables.Graph.Interfaces;
 using Drawie.Backend.Core.Surfaces;
 using Drawie.Backend.Core.Surfaces;
 using Drawie.Backend.Core.Surfaces.ImageData;
 using Drawie.Backend.Core.Surfaces.ImageData;
+using Drawie.Backend.Core.Surfaces.PaintImpl;
 using Drawie.Numerics;
 using Drawie.Numerics;
 using PixiEditor.ChangeableDocument.Rendering;
 using PixiEditor.ChangeableDocument.Rendering;
 
 

+ 3 - 0
src/PixiEditor/Views/Rendering/Scene.cs

@@ -200,6 +200,9 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
 
 
     protected override async void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
     protected override async void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
     {
     {
+        framebuffer?.Dispose();
+        framebuffer = null;
+
         if (initialized)
         if (initialized)
         {
         {
             surface.Dispose();
             surface.Dispose();