Skip to content

Commit 359bc73

Browse files
Remove enforceFillOrientation; simplify Reverse
1 parent 2fbb74a commit 359bc73

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

src/ImageSharp.Drawing/PathExtensions.Internal.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
using System.Buffers;
5-
64
namespace SixLabors.ImageSharp.Drawing;
75

86
/// <content>
@@ -17,7 +15,7 @@ public static partial class PathExtensions
1715
/// <returns>The reversed <see cref="IPath"/>.</returns>
1816
internal static IPath Reverse(this IPath path)
1917
{
20-
IEnumerable<LinearLineSegment> segments = path.Flatten().Select(p => new LinearLineSegment(p.Points.ToArray().Reverse().ToArray()));
18+
IEnumerable<LinearLineSegment> segments = path.Flatten().Select(p => new LinearLineSegment([.. p.Points.ToArray().Reverse()]));
2119
bool closed = false;
2220
if (path is ISimplePath sp)
2321
{

src/ImageSharp.Drawing/Processing/Backends/CompositionCommand.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public struct CompositionCommand
1818
private readonly Matrix4x4 transform;
1919
private readonly IReadOnlyList<IPath>? clipPaths;
2020
private readonly ShapeOptions shapeOptions;
21-
private readonly bool enforceFillOrientation;
2221

2322
private CompositionCommand(
2423
int definitionKey,
@@ -30,8 +29,7 @@ private CompositionCommand(
3029
Pen? pen,
3130
Matrix4x4 transform,
3231
IReadOnlyList<IPath>? clipPaths,
33-
ShapeOptions shapeOptions,
34-
bool enforceFillOrientation)
32+
ShapeOptions shapeOptions)
3533
{
3634
this.DefinitionKey = definitionKey;
3735
this.sourcePath = sourcePath;
@@ -47,7 +45,6 @@ private CompositionCommand(
4745
this.transform = transform;
4846
this.clipPaths = clipPaths;
4947
this.shapeOptions = shapeOptions;
50-
this.enforceFillOrientation = enforceFillOrientation;
5148
}
5249

5350
/// <summary>
@@ -117,10 +114,6 @@ private CompositionCommand(
117114
/// <param name="rasterizerOptions">Rasterizer options used to generate coverage.</param>
118115
/// <param name="shapeOptions">Shape options for clip operations.</param>
119116
/// <param name="transform">Transform matrix to apply during preparation.</param>
120-
/// <param name="enforceFillOrientation">
121-
/// When <see langword="true"/>, preparation normalizes closed contour orientation before rasterization.
122-
/// Callers should only enable this when they explicitly want contour winding rewritten.
123-
/// </param>
124117
/// <param name="destinationOffset">Absolute destination offset where coverage is composited.</param>
125118
/// <param name="pen">Optional pen for stroke commands. The batcher expands strokes to fills.</param>
126119
/// <param name="clipPaths">Optional clip paths to apply during preparation.</param>
@@ -132,7 +125,6 @@ public static CompositionCommand Create(
132125
in RasterizerOptions rasterizerOptions,
133126
ShapeOptions shapeOptions,
134127
Matrix4x4 transform,
135-
bool enforceFillOrientation,
136128
Point destinationOffset = default,
137129
Pen? pen = null,
138130
IReadOnlyList<IPath>? clipPaths = null)
@@ -149,8 +141,7 @@ public static CompositionCommand Create(
149141
pen,
150142
transform,
151143
clipPaths,
152-
shapeOptions,
153-
enforceFillOrientation);
144+
shapeOptions);
154145
}
155146

156147
/// <summary>

0 commit comments

Comments
 (0)