예제 #1
0
        public void EnsurePicture_AlreadyResolved()
        {
            SvgView view  = new SvgView();
            SKSvg   skSvg = new SKSvg();

            view.SetMemberValue("_skSvg", skSvg);
            view.CallPrivateMethod("EnsurePicture");
            Assert.AreEqual(skSvg, view.GetMemberValue <SKSvg>("_skSvg"));
        }
예제 #2
0
        private void TestGetScale(SvgStretch stretch, int canvasWidth, int canvasHeight, float svgWidth, float svgHeight, float expectedScaleX, float expectedScaleY)
        {
            SvgView svgView = new SvgView {
                Stretch = stretch
            };

            svgView.SetMemberValue("_svgRect", new SKRect(0, 0, svgWidth, svgHeight));
            SKImageInfo canvasInfo = new SKImageInfo(canvasWidth, canvasHeight);
            SKMatrix    result     = svgView.CallPrivateMethod <SKMatrix>("GetScaleMatrix", canvasInfo);

            Assert.AreEqual(expectedScaleX, result.ScaleX);
            Assert.AreEqual(expectedScaleY, result.ScaleY);
        }