super.applyPaint(paint, fill);
if (paint instanceof LinearGradientPaint) {
Pattern pattern = GradientMaker.makeLinearGradient((LinearGradientPaint) paint,
- getBaseTransform(), getTransform());
+ new AffineTransform(), new AffineTransform());
try {
gen.write(outputPattern(pattern));
} catch (IOException ioe) {
}
} else if (paint instanceof RadialGradientPaint) {
Pattern pattern = GradientMaker.makeRadialGradient((RadialGradientPaint) paint,
- getBaseTransform(), getTransform());
+ new AffineTransform(), new AffineTransform());
try {
gen.write(outputPattern(pattern));
} catch (IOException ioe) {
shading.output(out, doubleFormatter, functionRenderer);
}
- protected AffineTransform getBaseTransform() {
- AffineTransform at = new AffineTransform(this.getTransform());
- return at;
- }
-
/**
* Creates a new <code>Graphics</code> object that is
* a copy of this <code>Graphics</code> object.
ByteArrayOutputStream out = new ByteArrayOutputStream();
PSSVGGraphics2D svgGraphics2D = new PSSVGGraphics2D(false, new PSGenerator(out));
svgGraphics2D.setGraphicContext(new GraphicContext());
+ svgGraphics2D.translate(100, 100);
svgGraphics2D.applyPaint(gradient, true);
byte[] actual = out.toByteArray();
byte[] expected = IOUtils.toByteArray(getClass().getResourceAsStream(expectedResourceName));