Tweaked to handle updated line-height calculation code that will now return -1 sometimes

git-svn-id: svn://10.0.0.236/trunk@29986 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com 1999-05-03 20:54:11 +00:00
parent 95141d3623
commit 31352557b2
2 changed files with 20 additions and 6 deletions

View File

@ -1538,9 +1538,16 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
nsHTMLReflowState::CalcLineHeight(mPresContext, parentFrame);
nscoord contentHeight = parentPFD->mBounds.height -
parentPFD->mBorderPadding.top - parentPFD->mBorderPadding.bottom;
nscoord leading = logicalHeight - contentHeight;
psd->mTopLeading = leading / 2;
psd->mBottomLeading = leading - psd->mTopLeading;
if (logicalHeight > 0) {
nscoord leading = logicalHeight - contentHeight;
psd->mTopLeading = leading / 2;
psd->mBottomLeading = leading - psd->mTopLeading;
}
else {
psd->mTopLeading = 0;
psd->mBottomLeading = 0;
logicalHeight = contentHeight;
}
psd->mLogicalHeight = logicalHeight;
// The initial values for the min and max Y values are in the spans

View File

@ -1538,9 +1538,16 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
nsHTMLReflowState::CalcLineHeight(mPresContext, parentFrame);
nscoord contentHeight = parentPFD->mBounds.height -
parentPFD->mBorderPadding.top - parentPFD->mBorderPadding.bottom;
nscoord leading = logicalHeight - contentHeight;
psd->mTopLeading = leading / 2;
psd->mBottomLeading = leading - psd->mTopLeading;
if (logicalHeight > 0) {
nscoord leading = logicalHeight - contentHeight;
psd->mTopLeading = leading / 2;
psd->mBottomLeading = leading - psd->mTopLeading;
}
else {
psd->mTopLeading = 0;
psd->mBottomLeading = 0;
logicalHeight = contentHeight;
}
psd->mLogicalHeight = logicalHeight;
// The initial values for the min and max Y values are in the spans