if (currentBounds.intersects(lastBounds)) { if (direction == LEFT) { currentBounds.x = lastBounds.x + last.getWidth(); } else if (direction == RIGHT) { currentBounds.x = lastBounds.y - current.getWidth(); }
moveOver = true; }  if (currentBounds.y >= lastBounds.y && currentBounds.y < lastBounds.y + lastBounds.width) { moveOver = true; }  if (moveOver) { if (direction == LEFT) { currentBounds.x = lastBounds.x + last.getWidth(); } else if (direction == RIGHT) { currentBounds.x = lastBounds.x - current.getWidth();
    private void alignToLastFloat(CssContext cssCtx,             BlockFormattingContext bfc, FloatedBlockBox current, int direction) {                List floats = getFloats(direction);        if (floats.size() > 0) {            Point offset = bfc.getOffset();            FloatedBlockBox last = (FloatedBlockBox)floats.get(floats.size()-1);                        Rectangle currentBounds = current.getBounds(cssCtx, -offset.x, -offset.y);                        Point lastOffset = getOffset(last);            Rectangle lastBounds = last.getBounds(cssCtx, -lastOffset.x, -lastOffset.y);                        if (currentBounds.y < lastBounds.y) {                currentBounds.translate(0, lastBounds.y - currentBounds.y);                                if (currentBounds.intersects(lastBounds)) {                    if (direction == LEFT) {                        currentBounds.x = lastBounds.x + last.getWidth();                    } else if (direction == RIGHT) {                        currentBounds.x = lastBounds.y - current.getWidth();                    }                }                                currentBounds.translate(offset.x, offset.y);                                current.x = currentBounds.x;                current.y = currentBounds.y;            }        }    }