Exemplo n.º 1
0
        public void TestIntersected()
        {
            var s1 = new QRect();

            s1.X      = 0;
            s1.Y      = 0;
            s1.Width  = 500;
            s1.Height = 600;

            var s2 = new QRect();

            s2.X      = 400;
            s2.Y      = 500;
            s2.Width  = 500;
            s2.Height = 600;

            var inter = s1.Intersected(s2);

            Assert.AreEqual(400, inter.X);
            Assert.AreEqual(500, inter.Y);
            Assert.AreEqual(100, inter.Width);
            Assert.AreEqual(100, inter.Height);
        }
Exemplo n.º 2
0
        public void TestIntersected()
        {
            var s1 = new QRect();
            s1.X = 0;
            s1.Y = 0;
            s1.Width = 500;
            s1.Height = 600;

            var s2 = new QRect();
            s2.X = 400;
            s2.Y = 500;
            s2.Width = 500;
            s2.Height = 600;

            var inter = s1.Intersected(s2);

            Assert.AreEqual(400, inter.X);
            Assert.AreEqual(500, inter.Y);
            Assert.AreEqual(100, inter.Width);
            Assert.AreEqual(100, inter.Height);
        }