// Copyright (c) Six Labors. // Licensed under the Six Labors Split License. using System.Collections.Generic; using System.Numerics; namespace SixLabors.ImageSharp.Drawing { /// /// A path that is always empty. /// public sealed class EmptyPath : IPath { private static readonly LinearGeometry EmptyGeometry = new( new LinearGeometryInfo { Bounds = RectangleF.Empty, ContourCount = 0, PointCount = 0, SegmentCount = 0, NonHorizontalSegmentCountPixelBoundary = 0, NonHorizontalSegmentCountPixelCenter = 0 }, [], []); private EmptyPath(PathTypes pathType) => this.PathType = pathType; /// /// Gets the closed path instance of the empty path /// public static EmptyPath ClosedPath { get; } = new(PathTypes.Closed); /// /// Gets the open path instance of the empty path /// public static EmptyPath OpenPath { get; } = new(PathTypes.Open); /// public PathTypes PathType { get; } /// public RectangleF Bounds => RectangleF.Empty; /// public IPath AsClosedPath() => ClosedPath; /// public IEnumerable Flatten() => []; /// public LinearGeometry ToLinearGeometry(Vector2 scale) => EmptyGeometry; /// public IPath Transform(Matrix4x4 matrix) => this; } }