// The default dest image area is the same as the source
// image area. However, when an ImageLayout hint is set,
// this might be not true. So the destRect should be the
// intersection of the provided rectangle, the destination
// bounds and the source bounds.
destRect = destRect.intersection(s.getBounds());
Rectangle srcRect = new Rectangle(destRect);
srcRect.x -= getLeftPadding();
srcRect.width += getLeftPadding() + getRightPadding();
srcRect.y -= getTopPadding();
srcRect.height += getTopPadding() + getBottomPadding();