@@ -119,9 +119,7 @@ public void DrawImageOfDifferentPixelType<TPixel>(TestImageProvider<TPixel> prov
119119 public void WorksWithDifferentLocations ( TestImageProvider < Rgba32 > provider , int x , int y )
120120 {
121121 using Image < Rgba32 > background = provider . GetImage ( ) ;
122- using Image < Rgba32 > overlay = new ( 50 , 50 ) ;
123- Assert . True ( overlay . DangerousTryGetSinglePixelMemory ( out Memory < Rgba32 > overlayMem ) ) ;
124- overlayMem . Span . Fill ( Color . Black ) ;
122+ using Image < Rgba32 > overlay = new ( 50 , 50 , Color . Black . ToRgba32 ( ) ) ;
125123
126124 background . Mutate ( c => c . DrawImage ( overlay , new Point ( x , y ) , PixelColorBlendingMode . Normal , 1F ) ) ;
127125
@@ -138,6 +136,31 @@ public void WorksWithDifferentLocations(TestImageProvider<Rgba32> provider, int
138136 appendSourceFileOrDescription : false ) ;
139137 }
140138
139+ [ Theory ]
140+ [ WithSolidFilledImages ( 100 , 100 , "White" , PixelTypes . Rgba32 , 10 , 10 ) ]
141+ [ WithSolidFilledImages ( 100 , 100 , "White" , PixelTypes . Rgba32 , 50 , 25 ) ]
142+ [ WithSolidFilledImages ( 100 , 100 , "White" , PixelTypes . Rgba32 , 25 , 50 ) ]
143+ [ WithSolidFilledImages ( 100 , 100 , "White" , PixelTypes . Rgba32 , 50 , 50 ) ]
144+ public void WorksWithDifferentBounds ( TestImageProvider < Rgba32 > provider , int width , int height )
145+ {
146+ using Image < Rgba32 > background = provider . GetImage ( ) ;
147+ using Image < Rgba32 > overlay = new ( 50 , 50 , Color . Black . ToRgba32 ( ) ) ;
148+
149+ background . Mutate ( c => c . DrawImage ( overlay , new Rectangle ( 0 , 0 , width , height ) , PixelColorBlendingMode . Normal , 1F ) ) ;
150+
151+ background . DebugSave (
152+ provider ,
153+ testOutputDetails : $ "{ width } _{ height } ",
154+ appendPixelTypeToFileName : false ,
155+ appendSourceFileOrDescription : false ) ;
156+
157+ background . CompareToReferenceOutput (
158+ provider ,
159+ testOutputDetails : $ "{ width } _{ height } ",
160+ appendPixelTypeToFileName : false ,
161+ appendSourceFileOrDescription : false ) ;
162+ }
163+
141164 [ Theory ]
142165 [ WithFile ( TestImages . Png . Splash , PixelTypes . Rgba32 ) ]
143166 public void DrawTransformed < TPixel > ( TestImageProvider < TPixel > provider )
@@ -158,12 +181,12 @@ public void DrawTransformed<TPixel>(TestImageProvider<TPixel> provider)
158181 Point position = new ( ( image . Width - blend . Width ) / 2 , ( image . Height - blend . Height ) / 2 ) ;
159182 image . Mutate ( x => x . DrawImage ( blend , position , .75F ) ) ;
160183
161- image . DebugSave ( provider , appendSourceFileOrDescription : false , appendPixelTypeToFileName : false ) ;
184+ image . DebugSave ( provider , appendPixelTypeToFileName : false , appendSourceFileOrDescription : false ) ;
162185 image . CompareToReferenceOutput (
163186 ImageComparer . TolerantPercentage ( 0.002f ) ,
164187 provider ,
165- appendSourceFileOrDescription : false ,
166- appendPixelTypeToFileName : false ) ;
188+ appendPixelTypeToFileName : false ,
189+ appendSourceFileOrDescription : false ) ;
167190 }
168191
169192 [ Theory ]
@@ -179,9 +202,6 @@ public void NonOverlappingImageThrows(TestImageProvider<Rgba32> provider, int x,
179202
180203 Assert . Contains ( "does not overlap" , ex . ToString ( ) ) ;
181204
182- void Test ( )
183- {
184- background . Mutate ( context => context . DrawImage ( overlay , new Point ( x , y ) , new GraphicsOptions ( ) ) ) ;
185- }
205+ void Test ( ) => background . Mutate ( context => context . DrawImage ( overlay , new Point ( x , y ) , new GraphicsOptions ( ) ) ) ;
186206 }
187207}
0 commit comments