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 #region Using
using System.Drawing; using System.Drawing;
using System.Linq;
#endregion #endregion
/// <summary> /// <summary>
@ -20,6 +22,7 @@ namespace ImageProcessor.Imaging
public class ResizeLayer public class ResizeLayer
{ {
#region Constructors #region Constructors
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ResizeLayer"/> class. /// Initializes a new instance of the <see cref="ResizeLayer"/> class.
/// </summary> /// </summary>
@ -35,16 +38,21 @@ namespace ImageProcessor.Imaging
/// <param name="upscale"> /// <param name="upscale">
/// Whether to allow up-scaling of images. (Default true) /// Whether to allow up-scaling of images. (Default true)
/// </param> /// </param>
/// <param name="centerCoordinates">
/// The center coordinates (Default null)
/// </param>
public ResizeLayer( public ResizeLayer(
Size size, Size size,
ResizeMode resizeMode = ResizeMode.Pad, ResizeMode resizeMode = ResizeMode.Pad,
AnchorPosition anchorPosition = AnchorPosition.Center, AnchorPosition anchorPosition = AnchorPosition.Center,
bool upscale = true) bool upscale = true,
float[] centerCoordinates = null)
{ {
this.Size = size; this.Size = size;
this.Upscale = upscale; this.Upscale = upscale;
this.ResizeMode = resizeMode; this.ResizeMode = resizeMode;
this.AnchorPosition = anchorPosition; this.AnchorPosition = anchorPosition;
this.CenterCoordinates = centerCoordinates ?? new float[] { };
} }
#endregion #endregion
@ -101,7 +109,7 @@ namespace ImageProcessor.Imaging
&& this.ResizeMode == resizeLayer.ResizeMode && this.ResizeMode == resizeLayer.ResizeMode
&& this.AnchorPosition == resizeLayer.AnchorPosition && this.AnchorPosition == resizeLayer.AnchorPosition
&& this.Upscale == resizeLayer.Upscale && this.Upscale == resizeLayer.Upscale
&& this.CenterCoordinates == resizeLayer.CenterCoordinates; && this.CenterCoordinates.SequenceEqual(resizeLayer.CenterCoordinates);
} }
/// <summary> /// <summary>

Loading…
Cancel
Save