diff --git a/src/ImageSharp/Common/Helpers/ImageMaths.cs b/src/ImageSharp/Common/Helpers/ImageMaths.cs index cf0ac5c297..25df0ebf01 100644 --- a/src/ImageSharp/Common/Helpers/ImageMaths.cs +++ b/src/ImageSharp/Common/Helpers/ImageMaths.cs @@ -195,7 +195,7 @@ namespace ImageSharp break; } - Func, int> getMinY = pixels => + int GetMinY(PixelAccessor pixels) { for (int y = 0; y < height; y++) { @@ -209,9 +209,9 @@ namespace ImageSharp } return 0; - }; + } - Func, int> getMaxY = pixels => + int GetMaxY(PixelAccessor pixels) { for (int y = height - 1; y > -1; y--) { @@ -225,9 +225,9 @@ namespace ImageSharp } return height; - }; + } - Func, int> getMinX = pixels => + int GetMinX(PixelAccessor pixels) { for (int x = 0; x < width; x++) { @@ -241,9 +241,9 @@ namespace ImageSharp } return 0; - }; + } - Func, int> getMaxX = pixels => + int GetMaxX(PixelAccessor pixels) { for (int x = width - 1; x > -1; x--) { @@ -257,14 +257,14 @@ namespace ImageSharp } return height; - }; + } using (PixelAccessor bitmapPixels = bitmap.Lock()) { - topLeft.Y = getMinY(bitmapPixels); - topLeft.X = getMinX(bitmapPixels); - bottomRight.Y = (getMaxY(bitmapPixels) + 1).Clamp(0, height); - bottomRight.X = (getMaxX(bitmapPixels) + 1).Clamp(0, width); + topLeft.Y = GetMinY(bitmapPixels); + topLeft.X = GetMinX(bitmapPixels); + bottomRight.Y = (GetMaxY(bitmapPixels) + 1).Clamp(0, height); + bottomRight.X = (GetMaxX(bitmapPixels) + 1).Clamp(0, width); } return GetBoundingRectangle(topLeft, bottomRight);