cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y);
cc.setLocation((int) origin.getX(), (int) origin.getY());
    public static InlineBox generateReplacedInlineBox(Context c, Content content, int avail, InlineBox prev_align, LineBox curr_line) {        //Uu.p("generating replaced Inline Box");        Rectangle bounds = null;        BlockBox block = null;        JComponent cc = c.getNamespaceHandler().getCustomComponent(content.getElement(), c);        if (cc != null) {            bounds = cc.getBounds();        } else {            block = (BlockBox) Boxing.layout(c, content);            //Uu.p("got a block box from the sub layout: " + block);            bounds = new Rectangle(block.x, block.y, block.width, block.height);            //Uu.p("bounds = " + bounds);        }        /*         * joshy: change this to just modify the existing block instead of creating         * a  new one         */        // create new inline (null text is safe!)        InlineBlockBox box = new InlineBlockBox();        box.element = content.getElement();        //box.width = bounds.width;        //box.height = bounds.height;        CalculatedStyle style = c.getCurrentStyle();        // use the prev_align to calculate the Xx        if (prev_align != null && !prev_align.break_after) {            box.x = prev_align.x + prev_align.width;        } else {            box.x = 0;        }        box.y = 0;// it's relative to the line        box.break_after = true;        // do vertical alignment        VerticalAlign.setupVerticalAlign(c, style, box);        // adjust width based on borders and padding        //box.width += box.totalHorizontalPadding(c.getCurrentStyle());        //box.height += box.totalVerticalPadding();        box = box;        //joshy: activate this: box.block = block        //Uu.p("created a new inline box");        //box.replaced = true;        box.sub_block = block;        if (block != null) block.setParent(box);        box.component = cc;        // set up the extents        box.width = bounds.width + box.totalHorizontalPadding(c.getCurrentStyle());        box.height = bounds.height + box.totalVerticalPadding(c.getCurrentStyle());        box.break_after = false;        // if it won't fit on this line, then put it on the next one        if (box.width > avail && prev_align != null && !prev_align.break_after) {            box.break_before = true;            box.x = 0;        }        c.translate(box.x, box.y);        c.translateInsets(box);        if (cc != null) {            Point origin = c.getOriginOffset();            cc.setLocation((int) origin.getX(), (int) origin.getY() + curr_line.y);            c.getCanvas().add(cc);        }        c.untranslateInsets(box);        c.translate(-box.x, -box.y);        // return        //Uu.p("last replaced = " + box);        return box;    }