AxialShadingContext.java (pdfbox-2.0.23-src) | : | AxialShadingContext.java (pdfbox-2.0.24-src) | ||
---|---|---|---|---|
skipping to change at line 179 | skipping to change at line 179 | |||
return super.getColorModel(); | return super.getColorModel(); | |||
} | } | |||
@Override | @Override | |||
public Raster getRaster(int x, int y, int w, int h) | public Raster getRaster(int x, int y, int w, int h) | |||
{ | { | |||
// create writable raster | // create writable raster | |||
WritableRaster raster = getColorModel().createCompatibleWritableRaster(w , h); | WritableRaster raster = getColorModel().createCompatibleWritableRaster(w , h); | |||
boolean useBackground; | boolean useBackground; | |||
int[] data = new int[w * h * 4]; | int[] data = new int[w * h * 4]; | |||
float[] values = new float[2]; | ||||
for (int j = 0; j < h; j++) | for (int j = 0; j < h; j++) | |||
{ | { | |||
for (int i = 0; i < w; i++) | for (int i = 0; i < w; i++) | |||
{ | { | |||
useBackground = false; | useBackground = false; | |||
float[] values = new float[] { x + i, y + j }; | values[0] = x + i; | |||
values[1] = y + j; | ||||
rat.transform(values, 0, values, 0, 1); | rat.transform(values, 0, values, 0, 1); | |||
double inputValue = x1x0 * (values[0] - coords[0]) + y1y0 * (val ues[1] - coords[1]); | double inputValue = x1x0 * (values[0] - coords[0]) + y1y0 * (val ues[1] - coords[1]); | |||
// TODO this happens if start == end, see PDFBOX-1442 | // TODO this happens if start == end, see PDFBOX-1442 | |||
if (denom == 0) | if (denom == 0) | |||
{ | { | |||
if (getBackground() == null) | if (getBackground() == null) | |||
{ | { | |||
continue; | continue; | |||
} | } | |||
useBackground = true; | useBackground = true; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added |