コード例 #1
0
ファイル: QRectTests.cs プロジェクト: zhoulihe1981/QtSharp
        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);
        }
コード例 #2
0
ファイル: QRectTests.cs プロジェクト: nanox/QtSharp
        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);
        }