@@ -124,6 +124,32 @@ public void buildWithTwoStopsInTheMiddleTest() throws IOException, InterruptedEx
124
124
generateAndComparePdfs ("buildWithTwoStopsInTheMiddleTest.pdf" , targetBoundingBox , null , gradientBuilder );
125
125
}
126
126
127
+ @ Test
128
+ public void buildWithTwoStopsBeforeTheBeginningTest () throws IOException , InterruptedException {
129
+ Rectangle targetBoundingBox = new Rectangle (50f , 450f , 300f , 300f );
130
+ AbstractLinearGradientBuilder gradientBuilder = new LinearGradientBuilder ()
131
+ .setGradientVector (targetBoundingBox .getLeft () + 100f , targetBoundingBox .getBottom () + 100f ,
132
+ targetBoundingBox .getRight () - 100f , targetBoundingBox .getTop () - 100f )
133
+ .setSpreadMethod (GradientSpreadMethod .PAD )
134
+ .addColorStop (new GradientColorStop (ColorConstants .RED .getColorValue (), -0.1d , OffsetType .RELATIVE ))
135
+ .addColorStop (new GradientColorStop (ColorConstants .BLUE .getColorValue (), -0.2d , OffsetType .RELATIVE ));
136
+
137
+ generateAndComparePdfs ("buildWithTwoStopsBeforeTheBeginningTest.pdf" , targetBoundingBox , null , gradientBuilder );
138
+ }
139
+
140
+ @ Test
141
+ public void buildWithTwoStopsAfterTheEndTest () throws IOException , InterruptedException {
142
+ Rectangle targetBoundingBox = new Rectangle (50f , 450f , 300f , 300f );
143
+ AbstractLinearGradientBuilder gradientBuilder = new LinearGradientBuilder ()
144
+ .setGradientVector (targetBoundingBox .getLeft () + 100f , targetBoundingBox .getBottom () + 100f ,
145
+ targetBoundingBox .getRight () - 100f , targetBoundingBox .getTop () - 100f )
146
+ .setSpreadMethod (GradientSpreadMethod .PAD )
147
+ .addColorStop (new GradientColorStop (ColorConstants .RED .getColorValue (), 1.2d , OffsetType .RELATIVE ))
148
+ .addColorStop (new GradientColorStop (ColorConstants .BLUE .getColorValue (), 0d , OffsetType .RELATIVE ));
149
+
150
+ generateAndComparePdfs ("buildWithTwoStopsAfterTheEndTest.pdf" , targetBoundingBox , null , gradientBuilder );
151
+ }
152
+
127
153
@ Test
128
154
public void padCaseWithVeryCloseCornerStopsTest () throws IOException , InterruptedException {
129
155
Rectangle targetBoundingBox = new Rectangle (50f , 450f , 300f , 300f );
0 commit comments