Beispiel #1
0
        public void CanScaleByMagnitude(float w1, float h1, float mag, float w2, float h2)
        {
            var size = new Size2d(w1, h1);

            size.Scale(mag);

            DolphAssert.EqualF(w2, size.Width);
            DolphAssert.EqualF(h2, size.Height);
        }
Beispiel #2
0
        public void TestHashCode()
        {
            var size1 = new Size2d(1, 2);
            var size2 = new Size2d(1, 2);

            Assert.Equal(size1.GetHashCode(), size2.GetHashCode());

            size2.Scale(1.1f);

            Assert.NotEqual(size1.GetHashCode(), size2.GetHashCode());
        }
Beispiel #3
0
        public void CanScaleByVector(float w1, float h1, float x, float y, float w2, float h2)
        {
            var size = new Size2d(w1, h1);

            size.Scale(x, y);

            DolphAssert.EqualF(w2, size.Width);
            DolphAssert.EqualF(h2, size.Height);

            size = new Size2d(w1, h1);
            size.Scale(new Vector2d(x, y));

            DolphAssert.EqualF(w2, size.Width);
            DolphAssert.EqualF(h2, size.Height);
        }