/** * Sets the bottom of the Rectangle and determines the proper {link #verticalOffset} * to appropriately align the contents vertically. * @param value */ public void setBottom(float value) { super.setBottom(value); float firstLineRealHeight = firstLineRealHeight(); float totalHeight = ury - value; // can't use top (already compensates for cellspacing) float nonContentHeight = (cellpadding() * 2f) + (cellspacing() * 2f); nonContentHeight += getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); float interiorHeight = totalHeight - nonContentHeight; float extraHeight = 0.0f; switch (verticalAlignment) { case Element.ALIGN_BOTTOM: extraHeight = interiorHeight - contentHeight; break; case Element.ALIGN_MIDDLE: extraHeight = (interiorHeight - contentHeight) / 2.0f; break; default: // ALIGN_TOP extraHeight = 0f; } extraHeight += cellpadding() + cellspacing(); extraHeight += getBorderWidthInside(TOP); if (firstLine != null) { firstLine.height = firstLineRealHeight + extraHeight; } }
/** * Sets the bottom of the Rectangle and determines the proper {link #verticalOffset} * to appropriately align the contents vertically. * @param value */ public void setBottom(float value) { super.setBottom(value); float firstLineRealHeight = firstLineRealHeight(); float totalHeight = ury - value; // can't use top (already compensates for cellspacing) float nonContentHeight = (cellpadding() * 2f) + (cellspacing() * 2f); nonContentHeight += getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); float interiorHeight = totalHeight - nonContentHeight; float extraHeight = 0.0f; switch (verticalAlignment) { case Element.ALIGN_BOTTOM: extraHeight = interiorHeight - contentHeight; break; case Element.ALIGN_MIDDLE: extraHeight = (interiorHeight - contentHeight) / 2.0f; break; default: // ALIGN_TOP extraHeight = 0f; } extraHeight += cellpadding() + cellspacing(); extraHeight += getBorderWidthInside(TOP); if (firstLine != null) { firstLine.height = firstLineRealHeight + extraHeight; } }
/** * Sets the bottom of the Rectangle and determines the proper {link #verticalOffset} * to appropriately align the contents vertically. * @param value */ public void setBottom(float value) { super.setBottom(value); float firstLineRealHeight = firstLineRealHeight(); float totalHeight = ury - value; // can't use top (already compensates for cellspacing) float nonContentHeight = (cellpadding() * 2f) + (cellspacing() * 2f); nonContentHeight += getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); float interiorHeight = totalHeight - nonContentHeight; float extraHeight = 0.0f; switch (verticalAlignment) { case Element.ALIGN_BOTTOM: extraHeight = interiorHeight - contentHeight; break; case Element.ALIGN_MIDDLE: extraHeight = (interiorHeight - contentHeight) / 2.0f; break; default: // ALIGN_TOP extraHeight = 0f; } extraHeight += cellpadding() + cellspacing(); extraHeight += getBorderWidthInside(TOP); if (firstLine != null) { firstLine.height = firstLineRealHeight + extraHeight; } }
currentPosition -= lineHeight; if (currentPosition > (bottom + cellpadding + getBorderWidthInside(BOTTOM))) { result.add(line); } else {
currentPosition -= lineHeight; if (currentPosition > (bottom + cellpadding + getBorderWidthInside(BOTTOM))) { result.add(line); } else {
currentPosition -= lineHeight; if (currentPosition > (bottom + cellpadding + getBorderWidthInside(BOTTOM))) { result.add(line); } else {
right -= cellspacing + cellpadding; left += getBorderWidthInside(LEFT); right -= getBorderWidthInside(RIGHT); newBottom -= getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); setBottom(newBottom);
right -= cellspacing + cellpadding; left += getBorderWidthInside(LEFT); right -= getBorderWidthInside(RIGHT); newBottom -= getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); setBottom(newBottom);
right -= cellspacing + cellpadding; left += getBorderWidthInside(LEFT); right -= getBorderWidthInside(RIGHT); newBottom -= getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); setBottom(newBottom);