Browse Source

Fixing ResizeLayer equality operator

Former-commit-id: dabee33972495cebe6e8f3ed3c243d76c61fc0f8
Former-commit-id: 8142eecf4b6b2a7f26c1c226d3d1e312c9f40316
pull/17/head
James South 12 years ago
parent
commit
4636de13d6
  1. 12
      src/ImageProcessor/Imaging/ResizeLayer.cs

12
src/ImageProcessor/Imaging/ResizeLayer.cs

@ -12,6 +12,8 @@ namespace ImageProcessor.Imaging
{
#region Using
using System.Drawing;
using System.Linq;
#endregion
/// <summary>
@ -20,6 +22,7 @@ namespace ImageProcessor.Imaging
public class ResizeLayer
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="ResizeLayer"/> class.
/// </summary>
@ -35,16 +38,21 @@ namespace ImageProcessor.Imaging
/// <param name="upscale">
/// Whether to allow up-scaling of images. (Default true)
/// </param>
/// <param name="centerCoordinates">
/// The center coordinates (Default null)
/// </param>
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);
}
/// <summary>

Loading…
Cancel
Save