Beispiel #1
0
        public void FitRectNoScale()
        {
            var rect   = new Rect(0, 0, 500, 500);
            var width  = 500;
            var height = 500;

            var result = TransformHolderHelper.ComputeFitRect(rect, width, height);

            Assert.Equal(250, result.X);
            Assert.Equal(250, result.Y);
            Assert.Equal(1, result.Scale);
        }
Beispiel #2
0
        public void FitRectScalingTest()
        {
            var holder = new TransformHolder();

            var rect   = new Rect(0, 0, 1000, 1000);
            var width  = 500;
            var height = 500;

            var result = TransformHolderHelper.ComputeFitRect(rect, width, height);

            Assert.Equal(500, result.X);
            Assert.Equal(500, result.Y);
            Assert.Equal(0.5, result.Scale);
        }