lineBounds.translate(direction == LEFT ? fr.width : -fr.width, 0); xoff += fr.width;
int extraWidth = 0; if (direction == LEFT) { extraWidth = fr.x + fr.width - xoff; } else { extraWidth = (bfc.getWidth() - fr.x) - xoff; } lineBounds.translate(direction == LEFT ? extraWidth : -extraWidth, 0); xoff += extraWidth;
    private int getFloatDistance(CssContext cssCtx, BlockFormattingContext bfc,             LineBox line, List floatsList, int direction) {        if (floatsList.size() == 0) {            return 0;        }        int xoff = 0;                Point offset = bfc.getOffset();        Rectangle lineBounds = line.getBounds(cssCtx, -offset.x, -offset.y);                applyLineWidthHeightHack(line, lineBounds);        for (int i = 0; i < floatsList.size(); i++) {            // get the current float            BoxOffset floater = (BoxOffset) floatsList.get(i);            // create a rect from the box            Rectangle fr = floater.getBox().getBounds(cssCtx, -floater.getX(), -floater.getY());            if (lineBounds.intersects(fr)) {                lineBounds.translate(direction == LEFT ? fr.width : -fr.width, 0);                xoff += fr.width;            }        }        return xoff;    }