private static void adjustBoxForFloatRight(Rectangle layoutBox, float blockWidth) { layoutBox.setX(layoutBox.getRight() - blockWidth); layoutBox.setWidth(blockWidth); }
private static void adjustBoxForFloatRight(Rectangle layoutBox, float blockWidth) { layoutBox.setX(layoutBox.getRight() - blockWidth); layoutBox.setWidth(blockWidth); }
protected float applyBordersPaddingsMargins(Rectangle parentBBox, Border[] borders, UnitValue[] paddings) { float parentWidth = parentBBox.getWidth(); applyMargins(parentBBox, false); applyBorderBox(parentBBox, borders, false); if (isFixedLayout()) { parentBBox.setX((float) this.getPropertyAsFloat(Property.LEFT)); } applyPaddings(parentBBox, paddings, false); return parentWidth - parentBBox.getWidth(); }
private void applyFixedXOrYPosition(boolean isXPosition, Rectangle layoutBox) { if (isPositioned()) { if (isFixedLayout()) { if (isXPosition) { float x = (float) this.getPropertyAsFloat(Property.LEFT); layoutBox.setX(x); } else { float y = (float) this.getPropertyAsFloat(Property.BOTTOM); move(0, y - occupiedArea.getBBox().getY()); } } } }
protected float applyBordersPaddingsMargins(Rectangle parentBBox, Border[] borders, UnitValue[] paddings) { float parentWidth = parentBBox.getWidth(); applyMargins(parentBBox, false); applyBorderBox(parentBBox, borders, false); if (isFixedLayout()) { parentBBox.setX((float) this.getPropertyAsFloat(Property.LEFT)); } applyPaddings(parentBBox, paddings, false); return parentWidth - parentBBox.getWidth(); }
private void applyFixedXOrYPosition(boolean isXPosition, Rectangle layoutBox) { if (isPositioned()) { if (isFixedLayout()) { if (isXPosition) { float x = (float) this.getPropertyAsFloat(Property.LEFT); layoutBox.setX(x); } else { float y = (float) this.getPropertyAsFloat(Property.BOTTOM); move(0, y - occupiedArea.getBBox().getY()); } } } }
private void restoreLayoutBoxAfterFailedLayoutAttempt(Rectangle layoutBox) { layoutBox.setX(backupLayoutBox.getX()).setY(backupLayoutBox.getY()) .setWidth(backupLayoutBox.getWidth()).setHeight(backupLayoutBox.getHeight()); backupCollapseInfo.copyTo(collapseInfo); backupLayoutBox = null; backupCollapseInfo = null; }
private void restoreLayoutBoxAfterFailedLayoutAttempt(Rectangle layoutBox) { layoutBox.setX(backupLayoutBox.getX()).setY(backupLayoutBox.getY()) .setWidth(backupLayoutBox.getWidth()).setHeight(backupLayoutBox.getHeight()); backupCollapseInfo.copyTo(collapseInfo); backupLayoutBox = null; backupCollapseInfo = null; }
layoutBox.setX(left); layoutBox.setWidth(right - left);
layoutBox.setX(left); layoutBox.setWidth(right - left);
void fixOccupiedAreaIfOverflowedX(OverflowPropertyValue overflowX, Rectangle layoutBox) { if (isOverflowFit(overflowX)) { return; } if ((occupiedArea.getBBox().getWidth() > layoutBox.getWidth() || occupiedArea.getBBox().getLeft() < layoutBox.getLeft())) { occupiedArea.getBBox().setX(layoutBox.getX()).setWidth(layoutBox.getWidth()); } }
void fixOccupiedAreaIfOverflowedX(OverflowPropertyValue overflowX, Rectangle layoutBox) { if (isOverflowFit(overflowX)) { return; } if ((occupiedArea.getBBox().getWidth() > layoutBox.getWidth() || occupiedArea.getBBox().getLeft() < layoutBox.getLeft())) { occupiedArea.getBBox().setX(layoutBox.getX()).setWidth(layoutBox.getWidth()); } }
private void adjustPositionedRendererLayoutBoxWidth(IRenderer renderer, Rectangle fullBbox, Float left, Float right) { if (left != null) { fullBbox.setWidth(fullBbox.getWidth() - (float) left).setX(fullBbox.getX() + (float) left); } if (right != null) { fullBbox.setWidth(fullBbox.getWidth() - (float) right); } if (left == null && right == null && !renderer.hasProperty(Property.WIDTH)) { // Other, non-block renderers won't occupy full width anyway MinMaxWidth minMaxWidth = renderer instanceof BlockRenderer ? ((BlockRenderer) renderer).getMinMaxWidth() : null; if (minMaxWidth != null && minMaxWidth.getMaxWidth() < fullBbox.getWidth()) { fullBbox.setWidth(minMaxWidth.getMaxWidth() + AbstractRenderer.EPS); } } }
private void adjustPositionedRendererLayoutBoxWidth(IRenderer renderer, Rectangle fullBbox, Float left, Float right) { if (left != null) { fullBbox.setWidth(fullBbox.getWidth() - (float) left).setX(fullBbox.getX() + (float) left); } if (right != null) { fullBbox.setWidth(fullBbox.getWidth() - (float) right); } if (left == null && right == null && !renderer.hasProperty(Property.WIDTH)) { // Other, non-block renderers won't occupy full width anyway MinMaxWidth minMaxWidth = renderer instanceof BlockRenderer ? ((BlockRenderer) renderer).getMinMaxWidth() : null; if (minMaxWidth != null && minMaxWidth.getMaxWidth() < fullBbox.getWidth()) { fullBbox.setWidth(minMaxWidth.getMaxWidth() + AbstractRenderer.EPS); } } }
context.getCurrentViewPort().setX(currentViewPort.getX() / scaleWidth); context.getCurrentViewPort().setHeight(currentViewPort.getHeight() / scaleHeight); context.getCurrentViewPort().setY(currentViewPort.getY() / scaleHeight);
layoutBox.setX(left).setWidth(right - left);
layoutBox.setX(left).setWidth(right - left);
imageRectangle.setY(initialY); do { imageRectangle.setX(initialX); do { drawContext.getCanvas().addXObject(backgroundXObject, imageRectangle);
clippedArea.setX(area.getX()).setWidth(area.getWidth());
imageRectangle.setY(initialY); do { imageRectangle.setX(initialX); do { drawContext.getCanvas().addXObject(backgroundXObject, imageRectangle);