|
@@ -1,5 +1,6 @@
|
|
using System.Collections;
|
|
using System.Collections;
|
|
using ChunkyImageLib.Operations;
|
|
using ChunkyImageLib.Operations;
|
|
|
|
+using Drawie.Backend.Core.Bridge;
|
|
using PixiEditor.ChangeableDocument.Changeables.Interfaces;
|
|
using PixiEditor.ChangeableDocument.Changeables.Interfaces;
|
|
using PixiEditor.ChangeableDocument.Changes.Drawing.FloodFill;
|
|
using PixiEditor.ChangeableDocument.Changes.Drawing.FloodFill;
|
|
using Drawie.Backend.Core.ColorsImpl;
|
|
using Drawie.Backend.Core.ColorsImpl;
|
|
@@ -257,6 +258,7 @@ internal class MagicWandHelper
|
|
VecI pos,
|
|
VecI pos,
|
|
ColorBounds bounds, Lines lines)
|
|
ColorBounds bounds, Lines lines)
|
|
{
|
|
{
|
|
|
|
+ using var ctx = DrawingBackendApi.Current.RenderingDispatcher.EnsureContext();
|
|
if (!bounds.IsWithinBounds(referenceChunk.Surface.GetRawPixel(pos)))
|
|
if (!bounds.IsWithinBounds(referenceChunk.Surface.GetRawPixel(pos)))
|
|
{
|
|
{
|
|
return null;
|
|
return null;
|
|
@@ -264,7 +266,7 @@ internal class MagicWandHelper
|
|
|
|
|
|
bool[] pixelVisitedStates = new bool[chunkSize * chunkSize];
|
|
bool[] pixelVisitedStates = new bool[chunkSize * chunkSize];
|
|
|
|
|
|
- using var refPixmap = referenceChunk.Surface.DrawingSurface.PeekPixels();
|
|
|
|
|
|
+ using var refPixmap = referenceChunk.Surface.PeekPixels();
|
|
Half* refArray = (Half*)refPixmap.GetPixels();
|
|
Half* refArray = (Half*)refPixmap.GetPixels();
|
|
|
|
|
|
Stack<VecI> toVisit = new();
|
|
Stack<VecI> toVisit = new();
|