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

This commit is contained in:
kipp%netscape.com 1999-05-03 20:54:11 +00:00
Родитель 84849fa55f
Коммит fa151ce5d6
2 изменённых файлов: 20 добавлений и 6 удалений

Просмотреть файл

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

Просмотреть файл

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