if (back.getColor() != null) {
updateColor(back.getColor(), true);
fillRect(sx, sy, paddRectWidth, paddRectHeight);
}
if (back.getImageInfo() != null) {
ImageSize imageSize = back.getImageInfo().getSize();
saveGraphicsState();
clipRect(sx, sy, paddRectWidth, paddRectHeight);
int horzCount = (int)((paddRectWidth
* 1000 / imageSize.getWidthMpt()) + 1.0f);
int vertCount = (int)((paddRectHeight
* 1000 / imageSize.getHeightMpt()) + 1.0f);
if (back.getRepeat() == EN_NOREPEAT) {
horzCount = 1;
vertCount = 1;
} else if (back.getRepeat() == EN_REPEATX) {
vertCount = 1;
} else if (back.getRepeat() == EN_REPEATY) {
horzCount = 1;
}
//change from points to millipoints
sx *= 1000;
sy *= 1000;
if (horzCount == 1) {
sx += back.getHoriz();
}
if (vertCount == 1) {
sy += back.getVertical();
}
for (int x = 0; x < horzCount; x++) {
for (int y = 0; y < vertCount; y++) {
// place once
Rectangle2D pos;
// Image positions are relative to the currentIP/BP
pos = new Rectangle2D.Float(sx - currentIPPosition
+ (x * imageSize.getWidthMpt()),
sy - currentBPPosition
+ (y * imageSize.getHeightMpt()),
imageSize.getWidthMpt(),
imageSize.getHeightMpt());
drawImage(back.getURL(), pos);
}
}
restoreGraphicsState();