Browse Source

Fixing ResizeLayer equality operator

Former-commit-id: ed6c4e0bd7dc9d36be90110e90ca19fe407ed85b
Former-commit-id: f3c5cbcdbc83d805c6a6ca6508e43d8c03355892
af/merge-core
James South 12 years ago
parent
commit
b483d0caec
  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