diff --git a/SDFMapCreator.sln.DotSettings b/SDFMapCreator.sln.DotSettings
index bb7557b..d613c13 100644
--- a/SDFMapCreator.sln.DotSettings
+++ b/SDFMapCreator.sln.DotSettings
@@ -12,4 +12,8 @@
True
True
151
- WRAP_IF_LONG
\ No newline at end of file
+ WRAP_IF_LONG
+ True
+ True
+ True
+ True
\ No newline at end of file
diff --git a/SDFMapCreator/SdfKernels.Kernels.cs b/SDFMapCreator/SdfKernels.Kernels.cs
index ff401e9..fa5d860 100644
--- a/SDFMapCreator/SdfKernels.Kernels.cs
+++ b/SDFMapCreator/SdfKernels.Kernels.cs
@@ -39,7 +39,10 @@ public partial class SdfKernels {
var x = index.X;
var y = index.Y;
//if we are on the edge of the image, return false
- if (x == 0 || y == 0 || x == width - 1 || y == height - 1) return;
+ if (x == 0 || y == 0 || x == width - 1 || y == height - 1) {
+ mask[index].Y = 1f; //set the edge flag
+ return;
+ }
//check the 3x3 kernel
for (var xi = x - 1; xi <= x + 1; xi++) {
@@ -78,7 +81,7 @@ public partial class SdfKernels {
ArrayView2D sdfb,
ArrayView2D gradient
) { //early exit if not on mask
- if (mask[index].X == 0f || mask[index].Y > 0f) return;
+ if (mask[index].X == 0f) return;
var a = sdfa[index].X;
var b = sdfb[index].X;
gradient[index] = new(a / (a + b));