From d15d818e1ff820dc5f6de50c08daff28594de49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krysi=C5=84ski?= Date: Thu, 14 Dec 2023 14:13:09 +0100 Subject: [PATCH 1/3] Removed debug fella --- .../Changes/Drawing/SelectionToMask_Change.cs | 2 -- 1 file changed, 2 deletions(-) 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); From 27c6850d66d7338a6fce9b53ccf702558568d097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krysi=C5=84ski?= Date: Thu, 14 Dec 2023 14:16:23 +0100 Subject: [PATCH 2/3] Conditional SaveToDesktop --- src/ChunkyImageLib/Surface.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ChunkyImageLib/Surface.cs b/src/ChunkyImageLib/Surface.cs index 224076f2a..3e34f1598 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; } + [Conditional("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())); From e4bfaa02bf065ba58890d0624328847da83c3412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krysi=C5=84ski?= Date: Thu, 14 Dec 2023 14:19:28 +0100 Subject: [PATCH 3/3] Ifdef savetodesktop --- src/ChunkyImageLib/Surface.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ChunkyImageLib/Surface.cs b/src/ChunkyImageLib/Surface.cs index 3e34f1598..f68809b19 100644 --- a/src/ChunkyImageLib/Surface.cs +++ b/src/ChunkyImageLib/Surface.cs @@ -132,7 +132,7 @@ public unsafe bool IsFullyTransparent() return true; } - [Conditional("DEBUG")] +#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())); @@ -144,6 +144,7 @@ public void SaveToDesktop(string filename = "savedSurface.png") png.SaveTo(stream); } } +#endif private DrawingSurface CreateDrawingSurface() {