Skip to content

Commit d9f49b0

Browse files
Merge branch 'main' into js/v4-compatibility
2 parents c31a53d + 435aae4 commit d9f49b0

14 files changed

+29
-53
lines changed

.github/ISSUE_TEMPLATE/commercial-bug-report.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

ImageSharp.Drawing.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ EndProject
2828
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{FBE8C1AD-5AEC-4514-9B64-091D8E145865}"
2929
ProjectSection(SolutionItems) = preProject
3030
.github\ISSUE_TEMPLATE\config.yml = .github\ISSUE_TEMPLATE\config.yml
31-
.github\ISSUE_TEMPLATE\oss-bug-report.md = .github\ISSUE_TEMPLATE\oss-bug-report.md
31+
.github\ISSUE_TEMPLATE\oss-bug-report.yml = .github\ISSUE_TEMPLATE\oss-bug-report.yml
3232
EndProjectSection
3333
EndProject
3434
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{815C0625-CD3D-440F-9F80-2D83856AB7AE}"

src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
<ItemGroup>
4848
<PackageReference Include="SixLabors.Fonts" Version="2.0.7" />
4949
<PackageReference Include="SixLabors.ImageSharp" Version="4.0.0-alpha.0.18" />
50+
<PackageReference Include="SixLabors.Fonts" Version="2.0.8" />
51+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
5052
</ItemGroup>
5153
<Import Project="..\..\shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems" Label="Shared" />
5254
</Project>

src/ImageSharp.Drawing/Processing/RecolorBrush.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,15 @@ public RecolorBrushApplicator(
134134
/// <inheritdoc />
135135
public override void Apply(Span<float> scanline, int x, int y)
136136
{
137-
Span<float> amounts = this.blenderBuffers.AmountSpan.Slice(0, scanline.Length);
138-
Span<TPixel> overlays = this.blenderBuffers.OverlaySpan.Slice(0, scanline.Length);
137+
if (x < 0 || y < 0 || x >= this.Target.Width || y >= this.Target.Height)
138+
{
139+
return;
140+
}
141+
142+
// Limit the scanline to the bounds of the image relative to x.
143+
scanline = scanline[..Math.Min(this.Target.Width - x, scanline.Length)];
144+
Span<float> amounts = this.blenderBuffers.AmountSpan[..scanline.Length];
145+
Span<TPixel> overlays = this.blenderBuffers.OverlaySpan[..scanline.Length];
139146

140147
for (int i = 0; i < scanline.Length; i++)
141148
{

tests/ImageSharp.Drawing.Tests/Drawing/Text/DrawTextOnImageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public void FontShapesAreRenderedCorrectly_LargeText<TPixel>(
269269
string str = Repeat(" ", 78) + "THISISTESTWORDSTHISISTESTWORDSTHISISTESTWORDSTHISISTESTWORDSTHISISTESTWORDS";
270270
sb.Append(str);
271271

272-
string newLines = Repeat(Environment.NewLine, 61);
272+
string newLines = Repeat("\r\n", 31);
273273
sb.Append(newLines);
274274

275275
for (int i = 0; i < 10; i++)
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)