示例#1
0
        /// <summary>
        /// Clone this instance.
        /// </summary>
        /// <returns>The clone.</returns>
        public virtual KimonoBounds Clone()
        {
            // Make duplicate
            var newBounds = new KimonoBounds(this.Left, this.Top, this.Right, this.Bottom, this.State)
            {
                UniqueID        = this.UniqueID,
                RotationDegrees = this.RotationDegrees
            };

            // Return duplicate
            return(newBounds);
        }
示例#2
0
        /// <summary>
        /// Test to see if the given bounds in contained within this bounds.
        /// </summary>
        /// <returns><c>true</c>, if bounds was contained, <c>false</c> otherwise.</returns>
        /// <param name="bounds">The bounds to see if it is contained.</param>
        public virtual bool ContainsBounds(KimonoBounds bounds)
        {
            if (ValueBetween(bounds.Left, Left, Right) && ValueBetween(bounds.Top, Top, Bottom))
            {
                return(true);
            }
            else if (ValueBetween(bounds.Right, Left, Right) && ValueBetween(bounds.Bottom, Top, Bottom))
            {
                return(true);
            }

            // Not in bounds
            return(false);
        }