static void applyClearance(Rectangle layoutBox, MarginsCollapseHandler marginsCollapseHandler, float clearHeightAdjustment, boolean isFloat) { if (clearHeightAdjustment <= 0) { return; } if (marginsCollapseHandler == null || isFloat) { layoutBox.decreaseHeight(clearHeightAdjustment); } else { marginsCollapseHandler.applyClearance(clearHeightAdjustment); } }
static void applyClearance(Rectangle layoutBox, MarginsCollapseHandler marginsCollapseHandler, float clearHeightAdjustment, boolean isFloat) { if (clearHeightAdjustment <= 0) { return; } if (marginsCollapseHandler == null || isFloat) { layoutBox.decreaseHeight(clearHeightAdjustment); } else { marginsCollapseHandler.applyClearance(clearHeightAdjustment); } }
protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float bottomTableBorderWidth = (reverse ? -1 : 1) * getMaxBottomWidth(); layoutBox.decreaseHeight(bottomTableBorderWidth / 2); occupiedBox.moveDown(bottomTableBorderWidth / 2).increaseHeight(bottomTableBorderWidth / 2); return this; }
protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float bottomTableBorderWidth = (reverse ? -1 : 1) * getMaxBottomWidth(); layoutBox.decreaseHeight(bottomTableBorderWidth / 2); occupiedBox.moveDown(bottomTableBorderWidth / 2).increaseHeight(bottomTableBorderWidth / 2); return this; }
protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float topIndent = (reverse ? -1 : 1) * getMaxTopWidth(); layoutBox.decreaseHeight(topIndent / 2); occupiedBox.moveDown(topIndent / 2).increaseHeight(topIndent / 2); return this; }
protected TableBorders fixHeaderOccupiedArea(Rectangle occupiedBox, Rectangle layoutBox) { float topBorderMaxWidth = getMaxTopWidth(); layoutBox.increaseHeight(topBorderMaxWidth); occupiedBox.moveUp(topBorderMaxWidth).decreaseHeight(topBorderMaxWidth); return this; } // endregion
protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float topIndent = (reverse ? -1 : 1) * getMaxTopWidth(); layoutBox.decreaseHeight(topIndent / 2); occupiedBox.moveDown(topIndent / 2).increaseHeight(topIndent / 2); return this; }
@Override protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float bottomTableBorderWidth = (reverse ? -1 : 1) * getMaxBottomWidth(); layoutBox.decreaseHeight(bottomTableBorderWidth); occupiedBox.moveDown(bottomTableBorderWidth).increaseHeight(bottomTableBorderWidth); return this; }
@Override protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float topIndent = (reverse ? -1 : 1) * getMaxTopWidth(); layoutBox.decreaseHeight(topIndent); occupiedBox.moveDown(topIndent).increaseHeight(topIndent); return this; }
@Override protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float topIndent = (reverse ? -1 : 1) * getMaxTopWidth(); layoutBox.decreaseHeight(topIndent); occupiedBox.moveDown(topIndent).increaseHeight(topIndent); return this; }
@Override protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) { float bottomTableBorderWidth = (reverse ? -1 : 1) * getMaxBottomWidth(); layoutBox.decreaseHeight(bottomTableBorderWidth); occupiedBox.moveDown(bottomTableBorderWidth).increaseHeight(bottomTableBorderWidth); return this; }
protected TableBorders fixHeaderOccupiedArea(Rectangle occupiedBox, Rectangle layoutBox) { float topBorderMaxWidth = getMaxTopWidth(); layoutBox.increaseHeight(topBorderMaxWidth); occupiedBox.moveUp(topBorderMaxWidth).decreaseHeight(topBorderMaxWidth); return this; } // endregion
private void getRidOfCollapseArtifactsAtopOccupiedArea() { Rectangle bBox = renderer.getOccupiedArea().getBBox(); bBox.decreaseHeight(collapseInfo.getCollapseBefore().getCollapsedMarginsSize()); }
private void getRidOfCollapseArtifactsAtopOccupiedArea() { Rectangle bBox = renderer.getOccupiedArea().getBBox(); bBox.decreaseHeight(collapseInfo.getCollapseBefore().getCollapsedMarginsSize()); }
protected void applyLeading(float deltaY) { occupiedArea.getBBox().moveUp(deltaY); occupiedArea.getBBox().decreaseHeight(deltaY); for (IRenderer child : childRenderers) { if (!FloatingHelper.isRendererFloating(child)) { child.move(0, deltaY); } // TODO for floats we don't apply any leading for the moment (and therefore line-height for pdf2html is not entirely supported in terms of floats) } }
protected void applyLeading(float deltaY) { occupiedArea.getBBox().moveUp(deltaY); occupiedArea.getBBox().decreaseHeight(deltaY); for (IRenderer child : childRenderers) { if (!FloatingHelper.isRendererFloating(child)) { child.move(0, deltaY); } // TODO for floats we don't apply any leading for the moment (and therefore line-height for pdf2html is not entirely supported in terms of floats) } }
private void applySelfCollapsedKidMarginWithClearance(Rectangle layoutBox) { // Self-collapsed kid margin with clearance will not be applied to parent top margin // if parent is not self-collapsing. It's self-collapsing kid, thus we just can // add this area to occupied area of parent. float clearedKidMarginWithClearance = prevChildMarginInfo.getOwnCollapseAfter().getCollapsedMarginsSize(); renderer.getOccupiedArea().getBBox(). increaseHeight(clearedKidMarginWithClearance) .moveDown(clearedKidMarginWithClearance); layoutBox.decreaseHeight(clearedKidMarginWithClearance); }
private void applySelfCollapsedKidMarginWithClearance(Rectangle layoutBox) { // Self-collapsed kid margin with clearance will not be applied to parent top margin // if parent is not self-collapsing. It's self-collapsing kid, thus we just can // add this area to occupied area of parent. float clearedKidMarginWithClearance = prevChildMarginInfo.getOwnCollapseAfter().getCollapsedMarginsSize(); renderer.getOccupiedArea().getBBox(). increaseHeight(clearedKidMarginWithClearance) .moveDown(clearedKidMarginWithClearance); layoutBox.decreaseHeight(clearedKidMarginWithClearance); }
void fixOccupiedAreaIfOverflowedY(OverflowPropertyValue overflowY, Rectangle layoutBox) { if (isOverflowFit(overflowY)) { return; } if (occupiedArea.getBBox().getBottom() < layoutBox.getBottom()) { float difference = layoutBox.getBottom() - occupiedArea.getBBox().getBottom(); occupiedArea.getBBox().moveUp(difference).decreaseHeight(difference); } }
void fixOccupiedAreaIfOverflowedY(OverflowPropertyValue overflowY, Rectangle layoutBox) { if (isOverflowFit(overflowY)) { return; } if (occupiedArea.getBBox().getBottom() < layoutBox.getBottom()) { float difference = layoutBox.getBottom() - occupiedArea.getBBox().getBottom(); occupiedArea.getBBox().moveUp(difference).decreaseHeight(difference); } }