Пример #1
0
        public void SpanIteratorHasCorrectIntercepts()
        {
            var rectA = SKRectI.Create(10, 10, 100, 100);
            var rectB = SKRectI.Create(50, 50, 100, 100);

            using var region = new SKRegion(rectA);
            region.Op(rectB, SKRegionOperation.Union);

            using var iterator = region.CreateSpanIterator(30, 5, 200);

            Assert.True(iterator.Next(out var left, out var right));
            Assert.Equal(10, left);
            Assert.Equal(110, right);

            Assert.False(iterator.Next(out left, out right));
            Assert.Equal(0, left);
            Assert.Equal(0, right);

            Assert.False(iterator.Next(out left, out right));
            Assert.Equal(0, left);
            Assert.Equal(0, right);
        }