if (area.getIPD() > 0) {
int width = area.getIPD();
width += backProps.getPaddingStart(false, context);
width += backProps.getPaddingEnd(false, context);
back.setHoriz(backProps.backgroundPositionHorizontal.getValue(
new SimplePercentBaseContext(context,
LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL,
(width - back.getFopImage().getIntrinsicWidth())
)
));
} else {
//TODO Area IPD has to be set for this to work
log.warn("Horizontal background image positioning ignored"
+ " because the IPD was not set on the area."
+ " (Yes, it's a bug in FOP)");
}
}
}
if (backProps.backgroundPositionVertical != null) {
if (back.getRepeat() == Constants.EN_NOREPEAT
|| back.getRepeat() == Constants.EN_REPEATX) {
if (area.getBPD() > 0) {
int height = area.getBPD();
height += backProps.getPaddingBefore(false, context);
height += backProps.getPaddingAfter(false, context);
back.setVertical(backProps.backgroundPositionVertical.getValue(
new SimplePercentBaseContext(context,
LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL,
(height - back.getFopImage().getIntrinsicHeight())
)
));
} else {