/// <summary>
 /// Returns whether the rectangles are equal.
 /// </summary>
 /// <param name="other">The other recentalge.</param>
 /// <returns>Returns a value indicating if the rectangles are equal.</returns>
 public bool Equals(RectangularPolygon other)
 {
     return(other != null &&
            this.X == other.X &&
            this.Y == other.Y &&
            this.Height == other.Height &&
            this.Width == other.Width);
 }
Exemplo n.º 2
0
        public void Fill_RectangularPolygon <TPixel>(TestImageProvider <TPixel> provider)
            where TPixel : struct, IPixel <TPixel>
        {
            var polygon = new SixLabors.Shapes.RectangularPolygon(10, 10, 190, 140);
            var color   = Color.White;

            provider.RunValidatingProcessorTest(
                c => c.Fill(color, polygon),
                appendSourceFileOrDescription: false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Equality comparer for two RectangularPolygons
        /// </summary>
        /// <param name="obj">The polygon to compare to.</param>
        /// <returns>Returns a value indicating if the rectangles are equal.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            RectangularPolygon otherRectangle = (RectangularPolygon)obj;

            return(this.X == otherRectangle.X &&
                   this.Y == otherRectangle.Y &&
                   this.Height == otherRectangle.Height &&
                   this.Width == otherRectangle.Width);
        }