File tree Expand file tree Collapse file tree 2 files changed +34
-5
lines changed
src/ImageSharp.Drawing/Processing
tests/ImageSharp.Drawing.Tests/Issues Expand file tree Collapse file tree 2 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 44using System ;
55using System . Numerics ;
66using SixLabors . ImageSharp . Drawing . Utilities ;
7- using SixLabors . ImageSharp . Memory ;
87using SixLabors . ImageSharp . PixelFormats ;
98
109namespace SixLabors . ImageSharp . Drawing . Processing
@@ -118,8 +117,6 @@ private sealed class PatternBrushApplicator<TPixel> : BrushApplicator<TPixel>
118117 where TPixel : unmanaged, IPixel < TPixel >
119118 {
120119 private readonly DenseMatrix < TPixel > pattern ;
121- private readonly MemoryAllocator allocator ;
122- private readonly int scalineWidth ;
123120 private readonly ThreadLocalBlenderBuffers < TPixel > blenderBuffers ;
124121 private bool isDisposed ;
125122
@@ -138,8 +135,6 @@ public PatternBrushApplicator(
138135 : base ( configuration , options , source )
139136 {
140137 this . pattern = pattern ;
141- this . scalineWidth = source . Width ;
142- this . allocator = configuration . MemoryAllocator ;
143138 this . blenderBuffers = new ThreadLocalBlenderBuffers < TPixel > ( configuration . MemoryAllocator , source . Width ) ;
144139 }
145140
Original file line number Diff line number Diff line change 1+ // Copyright (c) Six Labors.
2+ // Licensed under the Apache License, Version 2.0.
3+
4+ using System . Numerics ;
5+ using SixLabors . Fonts ;
6+ using SixLabors . ImageSharp . Drawing . Processing ;
7+ using SixLabors . ImageSharp . PixelFormats ;
8+ using SixLabors . ImageSharp . Processing ;
9+ using Xunit ;
10+
11+ namespace SixLabors . ImageSharp . Drawing . Tests . Issues
12+ {
13+ public class Issue_241
14+ {
15+ [ Fact ]
16+ public void DoesNotThrowArgumentOutOfRangeException ( )
17+ {
18+ if ( ! TestEnvironment . IsWindows )
19+ {
20+ return ;
21+ }
22+
23+ FontFamily fontFamily = SystemFonts . Get ( "Arial" ) ;
24+ RichTextOptions opt = new ( fontFamily . CreateFont ( 100 , FontStyle . Regular ) )
25+ {
26+ Origin = new Vector2 ( 159 , 0 )
27+ } ;
28+ const string content = "TEST" ;
29+
30+ using Image image = new Image < Rgba32 > ( 512 , 256 , Color . Black ) ;
31+ image . Mutate ( x => x . DrawText ( opt , content , Brushes . Horizontal ( Color . Orange ) ) ) ;
32+ }
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments