diff --git a/src/ChunkyImageLib/Surface.cs b/src/ChunkyImageLib/Surface.cs index 224076f2a..f68809b19 100644 --- a/src/ChunkyImageLib/Surface.cs +++ b/src/ChunkyImageLib/Surface.cs @@ -1,4 +1,5 @@ -using System.Runtime.CompilerServices; +using System.Diagnostics; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using PixiEditor.DrawingApi.Core.ColorsImpl; using PixiEditor.DrawingApi.Core.Numerics; @@ -131,6 +132,7 @@ public unsafe bool IsFullyTransparent() return true; } +#if DEBUG public void SaveToDesktop(string filename = "savedSurface.png") { using var final = DrawingSurface.Create(new ImageInfo(Size.X, Size.Y, ColorType.Rgba8888, AlphaType.Premul, ColorSpace.CreateSrgb())); @@ -142,6 +144,7 @@ public void SaveToDesktop(string filename = "savedSurface.png") png.SaveTo(stream); } } +#endif private DrawingSurface CreateDrawingSurface() { diff --git a/src/PixiEditor.ChangeableDocument/Changes/Drawing/SelectionToMask_Change.cs b/src/PixiEditor.ChangeableDocument/Changes/Drawing/SelectionToMask_Change.cs index 33ac2cdd0..f23e324b1 100644 --- a/src/PixiEditor.ChangeableDocument/Changes/Drawing/SelectionToMask_Change.cs +++ b/src/PixiEditor.ChangeableDocument/Changes/Drawing/SelectionToMask_Change.cs @@ -48,8 +48,6 @@ public override bool InitializeAndValidate(Document target) image.SetBlendMode(blendMode); var selectionImage = FloodFillHelper.FillSelection(target, selection!); - - selectionImage.SaveToDesktop(); image.EnqueueDrawImage(new VecI(0, 0), selectionImage);