public void initStaticPos(LayoutContext c, BlockBox parent, int childOffset) { setX(0); setY(childOffset); }
public void initStaticPos(LayoutContext c, BlockBox parent, int childOffset) { setX(0); setY(childOffset); }
private void alignToLastOpposingFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) { List floats = getOpposingFloats(direction); if (floats.size() > 0) { Point offset = bfc.getOffset(); BoxOffset lastOffset = (BoxOffset) floats.get(floats.size() - 1); Rectangle currentBounds = current.getMarginEdge(cssCtx, -offset.x, -offset.y); Rectangle lastBounds = lastOffset.getBox().getMarginEdge(cssCtx, -lastOffset.getX(), -lastOffset.getY()); if (currentBounds.y < lastBounds.y) { currentBounds.translate(0, lastBounds.y - currentBounds.y); currentBounds.translate(offset.x, offset.y); current.setY(currentBounds.y); } } }
private void alignToLastOpposingFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) { List floats = getOpposingFloats(direction); if (floats.size() > 0) { Point offset = bfc.getOffset(); BoxOffset lastOffset = (BoxOffset) floats.get(floats.size() - 1); Rectangle currentBounds = current.getMarginEdge(cssCtx, -offset.x, -offset.y); Rectangle lastBounds = lastOffset.getBox().getMarginEdge(cssCtx, -lastOffset.getX(), -lastOffset.getY()); if (currentBounds.y < lastBounds.y) { currentBounds.translate(0, lastBounds.y - currentBounds.y); currentBounds.translate(offset.x, offset.y); current.setY(currentBounds.y); } } }
private void alignToStaticEquivalent() { if (_staticEquivalent.getAbsY() != getAbsY()) { setY(_staticEquivalent.getAbsY() - getAbsY()); setAbsY(_staticEquivalent.getAbsY()); } }
private void alignToStaticEquivalent() { if (_staticEquivalent.getAbsY() != getAbsY()) { setY(_staticEquivalent.getAbsY() - getAbsY()); setAbsY(_staticEquivalent.getAbsY()); } }
private void alignToLastFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) { List floats = getFloats(direction); if (floats.size() > 0) { Point offset = bfc.getOffset(); BoxOffset lastOffset = (BoxOffset) floats.get(floats.size() - 1); BlockBox last = (BlockBox) lastOffset.getBox(); Rectangle currentBounds = current.getMarginEdge(cssCtx, -offset.x, -offset.y); Rectangle lastBounds = last.getMarginEdge(cssCtx, -lastOffset.getX(), -lastOffset.getY()); boolean moveOver = false; if (currentBounds.y < lastBounds.y) { currentBounds.translate(0, lastBounds.y - currentBounds.y); moveOver = true; } if (currentBounds.y >= lastBounds.y && currentBounds.y < lastBounds.y + lastBounds.height) { moveOver = true; } if (moveOver) { if (direction == LEFT) { currentBounds.x = lastBounds.x + last.getWidth(); } else if (direction == RIGHT) { currentBounds.x = lastBounds.x - current.getWidth(); } currentBounds.translate(offset.x, offset.y); current.setX(currentBounds.x); current.setY(currentBounds.y); } } }
private void alignToLastFloat(CssContext cssCtx, BlockFormattingContext bfc, BlockBox current, int direction) { List floats = getFloats(direction); if (floats.size() > 0) { Point offset = bfc.getOffset(); BoxOffset lastOffset = (BoxOffset) floats.get(floats.size() - 1); BlockBox last = lastOffset.getBox(); Rectangle currentBounds = current.getMarginEdge(cssCtx, -offset.x, -offset.y); Rectangle lastBounds = last.getMarginEdge(cssCtx, -lastOffset.getX(), -lastOffset.getY()); boolean moveOver = false; if (currentBounds.y < lastBounds.y) { currentBounds.translate(0, lastBounds.y - currentBounds.y); moveOver = true; } if (currentBounds.y >= lastBounds.y && currentBounds.y < lastBounds.y + lastBounds.height) { moveOver = true; } if (moveOver) { if (direction == LEFT) { currentBounds.x = lastBounds.x + last.getWidth(); } else if (direction == RIGHT) { currentBounds.x = lastBounds.x - current.getWidth(); } currentBounds.translate(offset.x, offset.y); current.setX(currentBounds.x); current.setY(currentBounds.y); } } }
setY(0); if (!style.isIdent(CSSName.TOP, IdentValue.AUTO)) { setY((int) style.getFloatPropertyProportionalHeight(CSSName.TOP, cbContentHeight, cssCtx)); } else if (!style.isIdent(CSSName.BOTTOM, IdentValue.AUTO)) { setY(boundingBox.height - (int) style.getFloatPropertyProportionalWidth(CSSName.BOTTOM, cbContentHeight, cssCtx) - getHeight()); setY(getY() + boundingBox.y);
setY(0); if (!style.isIdent(CSSName.TOP, IdentValue.AUTO)) { setY((int) style.getFloatPropertyProportionalHeight(CSSName.TOP, cbContentHeight, cssCtx)); } else if (!style.isIdent(CSSName.BOTTOM, IdentValue.AUTO)) { setY(boundingBox.height - (int) style.getFloatPropertyProportionalWidth(CSSName.BOTTOM, cbContentHeight, cssCtx) - getHeight()); setY(getY() + boundingBox.y);
private void calcExtraPageClearance(LayoutContext c) { if (c.isPageBreaksAllowed() && c.getExtraSpaceTop() > 0 && (getStyle().isSpecifiedAsBlock() || getStyle().isListItem())) { PageBox first = c.getRootLayer().getFirstPage(c, this); if (first != null && first.getTop() + c.getExtraSpaceTop() > getAbsY()) { int diff = first.getTop() + c.getExtraSpaceTop() - getAbsY(); setY(getY() + diff); c.translate(0, diff); calcCanvasLocation(); } } }
private void calcExtraPageClearance(LayoutContext c) { if (c.isPageBreaksAllowed() && c.getExtraSpaceTop() > 0 && (getStyle().isSpecifiedAsBlock() || getStyle().isListItem())) { PageBox first = c.getRootLayer().getFirstPage(c, this); if (first != null && first.getTop() + c.getExtraSpaceTop() > getAbsY()) { int diff = first.getTop() + c.getExtraSpaceTop() - getAbsY(); setY(getY() + diff); c.translate(0, diff); calcCanvasLocation(); } } }
! block.getStyle().isForcePageBreakBefore()) { if (clearedPage) { block.setY(block.getY() - clearDelta); block.calcCanvasLocation();
! block.getStyle().isForcePageBreakBefore()) { if (clearedPage) { block.setY(block.getY() - clearDelta); block.calcCanvasLocation();