Browse Source

Fixed floodfill bug

flabbet 2 years ago
parent
commit
2e7be0e80a

+ 3 - 5
src/PixiEditor.ChangeableDocument/Changes/Drawing/FloodFill/FloodFillHelper.cs

@@ -193,11 +193,8 @@ internal static class FloodFillHelper
     {
         if (selection is null)
         {
-            fixed (byte* arr = array)
-            {
-                Unsafe.InitBlockUnaligned(arr, InSelection, (uint)(chunkSize * chunkSize));
-            }
-            return;
+            selection = new VectorPath();
+            selection.AddRect(globalBounds);
         }
 
         RectI localBounds = globalBounds.Offset(-chunkPos * chunkSize).Intersect(new(0, 0, chunkSize, chunkSize));
@@ -499,6 +496,7 @@ internal static class FloodFillHelper
     private static void AddCornerLines(VecI documentSize, VecI chunkOffset, Lines lines, VecI curPos, VecI clampedPos)
     {
         VecI globalPos = curPos + chunkOffset;
+
         if (globalPos.X == 0)
         {
             AddLine(