public ShapeRegionTests()
        {
            this.pathMock = new Mock <IPath>();

            this.bounds = new RectangleF(10.5f, 10, 10, 10);
            pathMock.Setup(x => x.Bounds).Returns(this.bounds);
            // wire up the 2 mocks to reference eachother
            pathMock.Setup(x => x.AsClosedPath()).Returns(() => pathMock.Object);
        }
Exemple #2
0
        // https://github.com/SixLabors/Fonts/issues/57

        public static RectangleF GetGlypthMaxBounds(this SixLabors.Fonts.RendererOptions options, params char[] characters)
        {
            var rect = new SixLabors.Primitives.RectangleF(float.PositiveInfinity, float.PositiveInfinity, float.NegativeInfinity, float.NegativeInfinity);

            foreach (var c in characters)
            {
                var r = options.GetCharacterGlypth(c).Bounds;

                rect = rect.IsInitialized() ? rect.UnionWith(r) : r;
            }

            return(rect);
        }
Exemple #3
0
 public static SD.RectangleF FromRectangleF(IS.RectangleF value)
 {
     return(new SD.RectangleF(value.X, value.Y, value.Width, value.Height));
 }