if (padding.right <= 0 && border.right <= 0) return;
    public static void paintRightPadding(Context c, LineBox line, InlineBox inline, int padX, Border margin, Border border, Border padding) {        int padding_yoff = margin.top + border.top + padding.top;        if (padding.right <= 0 && border.right <= 0) return;        int ty = line.getBaseline() - inline.y - inline.height - padding_yoff + line.y;        LineMetrics lm = FontUtil.getLineMetrics(c, inline);        ty += (int) lm.getDescent();        c.translate(padX, ty);        //int old_width = inline.width;        //int old_height = inline.height;        //sets the inline borders to the current style, so border objects will exist        //inline.height += margin.top + border.top + padding.top + padding.bottom + border.bottom + margin.bottom;        //inline.width = padding.right + border.right + margin.right;        if (padding.right > 0) {            // paint the background            Color background_color = BoxRendering.getBackgroundColor(c);            if (background_color != null) {                // skip transparent background                if (!background_color.equals(BackgroundPainter.transparent)) {                    Rectangle box = new Rectangle(inline.x,                            inline.y + margin.top + border.top,                            padding.right,                            inline.height + padding.top + padding.bottom);                    //TODO. make conf controlled Uu.p("filling a background");                    c.getGraphics().setColor(background_color);                    c.getGraphics().fillRect(box.x, box.y, box.width, box.height);                }            }        }        /*if (border.right > 0) {            Rectangle bounds = new Rectangle(inline.x,                    inline.y + margin.top,                    inline.width - margin.right,                    inline.height - margin.top - margin.bottom);            BorderPainter.paint(bounds, BorderPainter.RIGHT + BorderPainter.TOP + BorderPainter.BOTTOM, c.getCurrentStyle(), c.getGraphics(), c.getCtx());        }*/        //inline.width = old_width;        //inline.height = old_height;        //c.translate(+padding_xoff, -ty);        c.translate(-padX, -ty);        InlineBorder ib = (InlineBorder) c.getInlineBorders().removeLast();        for (Iterator i = c.getInlineBorders().iterator(); i.hasNext();) {            ((InlineBorder) i.next()).paint(c,                    line,                    padX + inline.x,                    padding.right + border.right,                    BorderPainter.TOP + BorderPainter.BOTTOM);        }        ib.paint(c, line, padX + inline.x, padding.right + border.right, BorderPainter.RIGHT + BorderPainter.TOP + BorderPainter.BOTTOM);    }