Exemplo n.º 1
0
        public void ArrangeSmallerThanContent()
        {
            var style = LayoutTestStyle.Create();
            var sc    = new Scrollbar(style)
            {
                ScrollContentHeight = 200
            };

            style.StyleResolver.AddRoot(sc);
            sc.Arrange(new Rectangle(10, 20, 300, 100));
            sc.LayoutRect.Should().Be(new Rectangle(300, 20, 10, 100));
            sc.MaximumVisibleOffset.Should().Be(100);
            sc.ScrollbarThumbHeight.Should().Be(50);
            sc.ScrollbarThumbOffset.Should().Be(0);
        }
Exemplo n.º 2
0
        public void ArrangeSmallerThanContentScrollingToMiddle()
        {
            var style = LayoutTestStyle.Create();
            var sc    = new Scrollbar(style)
            {
                ScrollContentHeight = 1000
            };

            style.StyleResolver.AddRoot(sc);
            sc.ScrollTo(450, true);

            sc.Arrange(new Rectangle(10, 20, 300, 100));

            sc.MaximumVisibleOffset.Should().Be(900);
            sc.ScrollbarThumbHeight.Should().Be(10);
            sc.ScrollbarThumbOffset.Should().Be(45);
        }