/** * 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; } }
float newBottom = top - contentHeight - (2f * cellpadding()) - (2f * cellspacing()); newBottom -= getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); setBottom(newBottom);
float newBottom = top - contentHeight - (2f * cellpadding()) - (2f * cellspacing()); newBottom -= getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); setBottom(newBottom);
float newBottom = top - contentHeight - (2f * cellpadding()) - (2f * cellspacing()); newBottom -= getBorderWidthInside(TOP) + getBorderWidthInside(BOTTOM); setBottom(newBottom);