Point pt = style.getBackgroundPosition(width - backImageWidth, height - backImageHeight, c.getCtx()); block.background_position_horizontal = (int) pt.getX(); block.background_position_vertical = (int) pt.getY(); }
Point pt = style.getBackgroundPosition(bounds.width - backImageWidth, bounds.height - backImageHeight, c.getCtx()); block.background_position_horizontal = (int) pt.getX(); block.background_position_vertical = (int) pt.getY();
    public static void paintBackground(Context c, Box box) {        Box block = box;        // cache the background color        //no sense getBackgroundColor(c);        // get the css properties        CalculatedStyle style = c.getCurrentStyle();        String back_image = style.getStringProperty(CSSName.BACKGROUND_IMAGE);        block.repeat = style.getIdent(CSSName.BACKGROUND_REPEAT);        block.attachment = style.getIdent(CSSName.BACKGROUND_ATTACHMENT);        // load the background image        block.background_image = null;        int backImageWidth = 0;        int backImageHeight = 0;        if (back_image != null && !"none".equals(back_image)) {            try {                block.background_image = c.getCtx().getUac().getImage(back_image);                block.background_uri = back_image;                backImageWidth = block.background_image.getWidth(null);                backImageHeight = block.background_image.getHeight(null);            } catch (Exception ex) {                ex.printStackTrace();                Uu.p(ex);            }        }        // handle image positioning issues        // need to update this to support vert and horz, not just vert        BlockFormattingContext bfc = c.getBlockFormattingContext();        if (bfc != null) {//this is not the root block            float width = bfc.getWidth();            float height = bfc.getHeight();            Point pt = style.getBackgroundPosition(width - backImageWidth, height - backImageHeight, c.getCtx());            block.background_position_horizontal = (int) pt.getX();            block.background_position_vertical = (int) pt.getY();        }        // actually paint the background        BackgroundPainter.paint(c, block);    }