From 4636de13d654b541a40fb7f9ca471b8a6739bf2d Mon Sep 17 00:00:00 2001 From: James South Date: Wed, 8 Oct 2014 13:10:37 +0100 Subject: [PATCH] Fixing ResizeLayer equality operator Former-commit-id: dabee33972495cebe6e8f3ed3c243d76c61fc0f8 Former-commit-id: 8142eecf4b6b2a7f26c1c226d3d1e312c9f40316 --- src/ImageProcessor/Imaging/ResizeLayer.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor/Imaging/ResizeLayer.cs b/src/ImageProcessor/Imaging/ResizeLayer.cs index b26631768..d4c114b1e 100644 --- a/src/ImageProcessor/Imaging/ResizeLayer.cs +++ b/src/ImageProcessor/Imaging/ResizeLayer.cs @@ -12,6 +12,8 @@ namespace ImageProcessor.Imaging { #region Using using System.Drawing; + using System.Linq; + #endregion /// @@ -20,6 +22,7 @@ namespace ImageProcessor.Imaging public class ResizeLayer { #region Constructors + /// /// Initializes a new instance of the class. /// @@ -35,16 +38,21 @@ namespace ImageProcessor.Imaging /// /// Whether to allow up-scaling of images. (Default true) /// + /// + /// The center coordinates (Default null) + /// public ResizeLayer( Size size, ResizeMode resizeMode = ResizeMode.Pad, AnchorPosition anchorPosition = AnchorPosition.Center, - bool upscale = true) + bool upscale = true, + float[] centerCoordinates = null) { this.Size = size; this.Upscale = upscale; this.ResizeMode = resizeMode; this.AnchorPosition = anchorPosition; + this.CenterCoordinates = centerCoordinates ?? new float[] { }; } #endregion @@ -101,7 +109,7 @@ namespace ImageProcessor.Imaging && this.ResizeMode == resizeLayer.ResizeMode && this.AnchorPosition == resizeLayer.AnchorPosition && this.Upscale == resizeLayer.Upscale - && this.CenterCoordinates == resizeLayer.CenterCoordinates; + && this.CenterCoordinates.SequenceEqual(resizeLayer.CenterCoordinates); } ///