Exemple #1
0
        public void CircumscribeRect()
        {
            Assert.AreEqual(rectI, rectD.Circumscribe());
            Assert.AreEqual(rectI, new RectD(1.6, 2.4, 3.2, 4.1).Circumscribe());
            Assert.AreEqual(new RectI(-3, -4, 20, 30), new RectD(-2.1, -3.2, 19.8, 29.1).Circumscribe());

            Assert.AreEqual(rectI, rectF.Circumscribe());
            Assert.AreEqual(rectI, new RectF(1.6f, 2.4f, 3.2f, 4.1f).Circumscribe());
            Assert.AreEqual(new RectI(-3, -4, 20, 30), new RectF(-2.1f, -3.2f, 19.8f, 29.1f).Circumscribe());
        }
Exemple #2
0
        public void Circumscribe()
        {
            Assert.AreEqual(rectD, RectD.Circumscribe(
                                rectD.TopLeft, rectD.TopRight, rectD.BottomLeft, rectD.BottomRight));

            Assert.AreEqual(rectF, RectF.Circumscribe(
                                rectF.TopLeft, rectF.TopRight, rectF.BottomLeft, rectF.BottomRight));

            // RectI.Circumscribe extends one past the specified points
            Assert.AreEqual(new RectI(1, 2, 5, 6), RectI.Circumscribe(
                                rectI.TopLeft, rectI.TopRight, rectI.BottomLeft, rectI.BottomRight));
        }