if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) {
return;
}
FSColor backgroundColor = style.getBackgroundColor();
FSImage backgroundImage = getBackgroundImage(c, style);
if ( (backgroundColor == null || backgroundColor == FSRGBColor.TRANSPARENT) &&
backgroundImage == null) {
return;
}
if (backgroundColor != null && backgroundColor != FSRGBColor.TRANSPARENT) {
setColor(backgroundColor);
fillRect(backgroundBounds.x, backgroundBounds.y, backgroundBounds.width, backgroundBounds.height);
}
if (backgroundImage != null) {
Rectangle localBGImageContainer = bgImageContainer;
if (style.isFixedBackground()) {
localBGImageContainer = c.getViewportRectangle();
}
int xoff = localBGImageContainer.x;
int yoff = localBGImageContainer.y;
Shape oldclip = getClip();
clip(backgroundBounds);
float imageWidth = backgroundImage.getWidth();
float imageHeight = backgroundImage.getHeight();
BackgroundPosition position = style.getBackgroundPosition();
xoff += calcOffset(
c, style, position.getHorizontal(), localBGImageContainer.width, imageWidth);
yoff += calcOffset(