if (block.attachment != null && block.attachment.equals("fixed")) { tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); } else {  tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert); }
tileFill(c.getGraphics(), block.background_image, new Rectangle(left_insets, top_insets, back_width, back_height), xoff, -yoff, horiz, vert);
    public static void paint(Context c, Box block) {        // don't draw if the backgrounds are turned off        if (!Configuration.isTrue("xr.renderer.draw.backgrounds", true)) {            return;        }        int width = block.getWidth();        int height = block.getHeight();        Border border = c.getCurrentStyle().getBorderWidth(c.getCtx());        if (border == null) {            return;        }        Border margin = c.getCurrentStyle().getMarginWidth(width, height, c.getCtx());        Rectangle box = new Rectangle(block.x + margin.left + border.left,                block.y + margin.top + border.top,                block.width - margin.left - margin.right - border.left - border.right,                block.height - margin.top - border.top - border.bottom - margin.bottom);        // paint the background        Color background_color = BoxRendering.getBackgroundColor(c);        if (background_color != null) {            // skip transparent background            if (!background_color.equals(transparent)) {                //TODO. make conf controlled Uu.p("filling a background");                c.getGraphics().setColor(background_color);                c.getGraphics().fillRect(box.x, box.y, box.width + 1, box.height + 1);            }        }        int xoff = 0;        int yoff = 0;        if (block.attachment == IdentValue.FIXED) {            yoff = c.getCanvas().getLocation().y;            //TODO. make conf controlled Uu.p("setting the clip rect for fixed background");            c.getGraphics().setClip(c.getCanvas().getVisibleRect());        }        if (block.background_image != null) {            int left_insets = box.x;            int top_insets = box.y;            int back_width = box.width;            int back_height = box.height;            Rectangle2D oldclip = (Rectangle2D) c.getGraphics().getClip();            Rectangle new_clip = new Rectangle(left_insets, top_insets, back_width, back_height);            c.getGraphics().setClip(oldclip.createIntersection(new_clip));            xoff += block.background_position_horizontal;            yoff -= block.background_position_vertical;            // tile the image as appropriate            // do fixed tile image            boolean horiz = false;            boolean vert = false;            if (block.repeat == IdentValue.REPEAT_X) {                horiz = true;                vert = false;            }            if (block.repeat == IdentValue.REPEAT_Y) {                horiz = false;                vert = true;            }            if (block.repeat == IdentValue.REPEAT) {                horiz = true;                vert = true;            }            //TODO. make conf controlled Uu.p("filling background with an image");            // fixed tiled image            if (block.attachment != null && block.attachment.equals("fixed")) {                tileFill(c.getGraphics(), block.background_image,                        new Rectangle(left_insets, top_insets, back_width, back_height),                        xoff, -yoff, horiz, vert);            } else {                // do normal tile image                tileFill(c.getGraphics(), block.background_image,                        new Rectangle(left_insets, top_insets, back_width, back_height),                        xoff, -yoff, horiz, vert);            }            //TODO. make conf controlled Uu.p("setting the clip rect");            c.getGraphics().setClip(oldclip);        }    }