Example #1
0
        /// <summary>
        /// prüft, ob sich aRect und bRect echt überschneiden
        /// </summary>
        /// <param name="aRect">erstes Rechteck</param>
        /// <param name="bRect">zweites Rechteck</param>
        /// <returns></returns>
        private bool IntersectsTrue(RectangleF aRect, RectangleF bRect)
        {
            Interval<float> aHorizontal = new Interval<float>(aRect.Left, aRect.Right);
            Interval<float> aVertical = new Interval<float>(aRect.Top, aRect.Bottom);

            Interval<float> bHorizontal = new Interval<float>(bRect.Left, bRect.Right);
            Interval<float> bVertical = new Interval<float>(bRect.Top, bRect.Bottom);

            return (aHorizontal.IntersectsTrue(bHorizontal) && aVertical.IntersectsTrue(bVertical));
        }