oldParamBlock.getIntParameter(1),
srcBounds.height + topPad +
oldParamBlock.getIntParameter(3));
// Determine invalid area by subtracting source bounds.
Area invalidArea = new Area(dstBounds);
invalidArea.subtract(new Area(srcBounds));
invalidRegion = invalidArea;
} else if((newParamBlock.getIntParameter(1) < // new R < old R
oldParamBlock.getIntParameter(1) &&
newParamBlock.getIntParameter(3) <= // new B <= old B
oldParamBlock.getIntParameter(3)) ||
(newParamBlock.getIntParameter(3) < // new B < old B
oldParamBlock.getIntParameter(3) &&
newParamBlock.getIntParameter(1) <= // new R <= old R
oldParamBlock.getIntParameter(1))) {
// One or both right and bottom padding decreased.
// Get source and the left and top padding.
RenderedImage src = oldParamBlock.getRenderedSource(0);
int leftPad = oldParamBlock.getIntParameter(0);
int topPad = oldParamBlock.getIntParameter(2);
// Get source bounds.
Rectangle srcBounds =
new Rectangle(src.getMinX(), src.getMinY(),
src.getWidth(), src.getHeight());
// Get old destination bounds.
Rectangle oldBounds =
new Rectangle(srcBounds.x - leftPad,
srcBounds.y - topPad,
srcBounds.width + leftPad +
oldParamBlock.getIntParameter(1),
srcBounds.height + topPad +
oldParamBlock.getIntParameter(3));
// Get new destination bounds.
Rectangle newBounds =
new Rectangle(srcBounds.x - leftPad,
srcBounds.y - topPad,
srcBounds.width + leftPad +
newParamBlock.getIntParameter(1),
srcBounds.height + topPad +
newParamBlock.getIntParameter(3));
// Determine invalid area by subtracting new from old bounds.
Area invalidArea = new Area(oldBounds);
invalidArea.subtract(new Area(newBounds));
invalidRegion = invalidArea;
} else {
// Either nothing changed or one or both of the right and bottom
// padding was increased.