Fixed scroll-frame code to properly fill in the max-element-size

This commit is contained in:
kipp%netscape.com 1998-11-21 03:52:01 +00:00
Родитель d54e47a11d
Коммит 55cb6eedb8
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -338,7 +338,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext,
nsSize kidReflowSize(scrollAreaSize.width, NS_UNCONSTRAINEDSIZE);
nsHTMLReflowState kidReflowState(aPresContext, mFirstChild, aReflowState,
kidReflowSize);
nsHTMLReflowMetrics kidDesiredSize(nsnull);
nsHTMLReflowMetrics kidDesiredSize(aDesiredSize.maxElementSize);
ReflowChild(mFirstChild, aPresContext, kidDesiredSize, kidReflowState, aStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
@ -405,6 +405,15 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext,
aDesiredSize.height += NSToCoordRound(sbHeight);
}
if (nsnull != aDesiredSize.maxElementSize) {
nscoord maxWidth = aDesiredSize.maxElementSize->width;
maxWidth += border.left + border.right + NSToCoordRound(sbWidth);
nscoord maxHeight = aDesiredSize.maxElementSize->height;
maxHeight += border.top + border.bottom;
aDesiredSize.maxElementSize->width = maxWidth;
aDesiredSize.maxElementSize->height = maxHeight;
}
aDesiredSize.ascent = aDesiredSize.height;
aDesiredSize.descent = 0;