@@ -46,7 +46,7 @@ public static void BeforeClass() {
46
46
public virtual void BuildWithNullArgumentsAndWithoutSettersTest ( ) {
47
47
Rectangle targetBoundingBox = new Rectangle ( 50f , 450f , 300f , 300f ) ;
48
48
AbstractLinearGradientBuilder gradientBuilder = new LinearGradientBuilder ( ) ;
49
- NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null ) ) ;
49
+ NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null , null ) ) ;
50
50
}
51
51
52
52
[ NUnit . Framework . Test ]
@@ -206,7 +206,7 @@ public virtual void BuildWithNullArgumentsAndWithoutStopsTest() {
206
206
AbstractLinearGradientBuilder gradientBuilder = new LinearGradientBuilder ( ) . SetGradientVector ( targetBoundingBox
207
207
. GetLeft ( ) + 100f , targetBoundingBox . GetBottom ( ) + 100f , targetBoundingBox . GetRight ( ) - 100f , targetBoundingBox
208
208
. GetTop ( ) - 100f ) . SetSpreadMethod ( GradientSpreadMethod . PAD ) ;
209
- NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( null , null ) ) ;
209
+ NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( null , null , null ) ) ;
210
210
}
211
211
212
212
[ NUnit . Framework . Test ]
@@ -646,7 +646,7 @@ public virtual void BuildWithTwoStopsBeforeTheBeginningAndNoneTest() {
646
646
. GetTop ( ) - 100f ) . SetSpreadMethod ( GradientSpreadMethod . NONE ) . AddColorStop ( new GradientColorStop ( ColorConstants
647
647
. RED . GetColorValue ( ) , - 10d , GradientColorStop . OffsetType . RELATIVE ) ) . AddColorStop ( new GradientColorStop
648
648
( ColorConstants . BLUE . GetColorValue ( ) , - 5d , GradientColorStop . OffsetType . RELATIVE ) ) ;
649
- NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null ) ) ;
649
+ NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null , null ) ) ;
650
650
}
651
651
652
652
[ NUnit . Framework . Test ]
@@ -657,7 +657,7 @@ public virtual void BuildWithTwoStopsAfterEndAndNoneTest() {
657
657
. GetTop ( ) - 100f ) . SetSpreadMethod ( GradientSpreadMethod . NONE ) . AddColorStop ( new GradientColorStop ( ColorConstants
658
658
. RED . GetColorValue ( ) , 5d , GradientColorStop . OffsetType . RELATIVE ) ) . AddColorStop ( new GradientColorStop ( ColorConstants
659
659
. BLUE . GetColorValue ( ) , 10d , GradientColorStop . OffsetType . RELATIVE ) ) ;
660
- NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null ) ) ;
660
+ NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null , null ) ) ;
661
661
}
662
662
663
663
[ NUnit . Framework . Test ]
@@ -668,7 +668,7 @@ public virtual void BuildWithTwoEqualOffsetsStopsAndNoneTest() {
668
668
. GetTop ( ) - 100f ) . SetSpreadMethod ( GradientSpreadMethod . NONE ) . AddColorStop ( new GradientColorStop ( ColorConstants
669
669
. RED . GetColorValue ( ) , 0.5d , GradientColorStop . OffsetType . RELATIVE ) ) . AddColorStop ( new GradientColorStop
670
670
( ColorConstants . BLUE . GetColorValue ( ) , 0.5d , GradientColorStop . OffsetType . RELATIVE ) ) ;
671
- NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null ) ) ;
671
+ NUnit . Framework . Assert . IsNull ( gradientBuilder . BuildColor ( targetBoundingBox , null , null ) ) ;
672
672
}
673
673
674
674
[ NUnit . Framework . Test ]
@@ -702,8 +702,8 @@ private void GenerateAndComparePdfs(String fileName, Rectangle toDraw, AffineTra
702
702
if ( transform != null ) {
703
703
canvas . ConcatMatrix ( transform ) ;
704
704
}
705
- canvas . SetFillColor ( gradientBuilder . BuildColor ( toDraw , transform ) ) . SetStrokeColor ( ColorConstants . BLACK ) . Rectangle
706
- ( toDraw ) . FillStroke ( ) ;
705
+ canvas . SetFillColor ( gradientBuilder . BuildColor ( toDraw , transform , pdfDoc ) ) . SetStrokeColor ( ColorConstants . BLACK
706
+ ) . Rectangle ( toDraw ) . FillStroke ( ) ;
707
707
}
708
708
NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outPdfPath , sourceFolder + "cmp_" + fileName
709
709
, destinationFolder , "diff" ) ) ;
@@ -714,7 +714,7 @@ private void GenerateAndComparePdfsWithoutArgumentToBuild(String fileName, Recta
714
714
String outPdfPath = destinationFolder + fileName ;
715
715
using ( PdfDocument pdfDoc = new PdfDocument ( new PdfWriter ( new FileInfo ( outPdfPath ) ) ) ) {
716
716
PdfCanvas canvas = new PdfCanvas ( pdfDoc . AddNewPage ( ) ) ;
717
- canvas . SetFillColor ( gradientBuilder . BuildColor ( null , null ) ) . SetStrokeColor ( ColorConstants . BLACK ) . Rectangle
717
+ canvas . SetFillColor ( gradientBuilder . BuildColor ( null , null , pdfDoc ) ) . SetStrokeColor ( ColorConstants . BLACK ) . Rectangle
718
718
( toDraw ) . FillStroke ( ) ;
719
719
}
720
720
NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outPdfPath , sourceFolder + "cmp_" + fileName
0 commit comments