Skip to content

Commit c5c823c

Browse files
Fix merge conflicts and missing test output
1 parent f8a963b commit c5c823c

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

src/ImageSharp.Drawing/Common/Extensions/GraphicsOptionsExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static bool IsOpaqueColorWithoutBlending(this GraphicsOptions options, Co
3838
return false;
3939
}
4040

41-
if (color.ToScaledVector4().W != Opaque)
41+
if (color.ToScaledVector4().W != opaque)
4242
{
4343
return false;
4444
}

src/ImageSharp.Drawing/Processing/Pen.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ protected Pen(Brush strokeFill, float strokeWidth, float[] strokePattern)
5252
{
5353
Guard.NotNull(strokeFill, nameof(strokeFill));
5454

55-
// Guard.MustBeGreaterThan(strokeWidth, 0, nameof(strokeWidth));
55+
Guard.MustBeGreaterThan(strokeWidth, 0, nameof(strokeWidth));
5656
Guard.NotNull(strokePattern, nameof(strokePattern));
5757

5858
this.StrokeFill = strokeFill;
59-
this.StrokeWidth = strokeWidth > 0 ? strokeWidth : 1;
59+
this.StrokeWidth = strokeWidth;
6060
this.pattern = strokePattern;
6161
}
6262

src/ImageSharp.Drawing/Shapes/EllipsePolygon.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ public override IPath Transform(Matrix3x2 matrix)
7979
/// <inheritdoc />
8080
// TODO switch this out to a calculated algorithm
8181
SegmentInfo IPathInternals.PointAlongPath(float distance)
82-
=> this.innerPath.PointAlongPath(distance);
83-
84-
/// <inheritdoc/>
85-
IReadOnlyList<InternalPath> IInternalPathOwner.GetRingsAsInternalPath()
86-
=> [this.innerPath];
82+
=> this.InnerPath.PointAlongPath(distance);
8783

8884
private static CubicBezierLineSegment CreateSegment(Vector2 location, SizeF size)
8985
{

src/ImageSharp.Drawing/Shapes/Polygon.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal Polygon(Path path)
5656
}
5757

5858
internal Polygon(ILineSegment[] segments, bool owned)
59-
: base(owned ? segments : segments.ToArray())
59+
: base(owned ? segments : [.. segments])
6060
{
6161
}
6262

tests/ImageSharp.Drawing.Tests/Drawing/FillPatternBrushTests.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ private void Test(string name, Color background, Brush brush, Color[,] expectedP
3030
int offsetY = r.Next(image.Height / yStride) * yStride;
3131
for (int x = 0; x < xStride; x++)
3232
{
33-
int actualX = x + offsetX;
34-
int actualY = y + offsetY;
35-
Rgba32 expected = expectedPatternFast[y, x].ToPixel<Rgba32>(); // inverted pattern
36-
Rgba32 actual = sourcePixels[actualX, actualY];
37-
if (expected != actual)
33+
for (int y = 0; y < yStride; y++)
3834
{
3935
int actualX = x + offsetX;
4036
int actualY = y + offsetY;
@@ -46,10 +42,10 @@ private void Test(string name, Color background, Brush brush, Color[,] expectedP
4642
}
4743
}
4844
}
49-
}
5045

51-
image.Mutate(x => x.Resize(80, 80, KnownResamplers.NearestNeighbor));
52-
image.Save($"{path}/{name}x4.png");
46+
image.Mutate(x => x.Resize(80, 80, KnownResamplers.NearestNeighbor));
47+
image.Save($"{path}/{name}x4.png");
48+
}
5349
}
5450

5551
[Fact]
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)