Example #1
0
        public static ValueIntRectangle GetUnion <TRoundedRectangle>(TRoundedRectangle a,
                                                                     IRoundedRectangle b)
            where TRoundedRectangle : IRoundedRectangle
        {
            var x1 = Math.Min(a.X, b.X);
            var x2 = Math.Max(a.X + a.Width, b.X + b.Width);
            var y1 = Math.Min(a.Y, b.Y);
            var y2 = Math.Max(a.Y + a.Height, b.Y + b.Height);

            return(new ValueIntRectangle(x1, y1, x2 - x1, y2 - y1));
        }
Example #2
0
        public Boolean Equals(IRoundedRectangle?other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            IRoundedRectangle me = this;

            return(me.X.Equals(other.X) &&
                   me.Y.Equals(other.Y) &&
                   me.Width.Equals(other.Width) &&
                   me.Height.Equals(other.Height));
        }
 public ValueIntRectangle GetUnion(IRoundedRectangle other)
 {
     return(GeometryHelper.GetUnion(this, other));
 }