support for constrained width, height

This commit is contained in:
karnaze@netscape.com
1998-10-19 23:02:41 +00:00
parent e6f023d783
commit d8ddacd62f
6 changed files with 44 additions and 0 deletions

View File

@@ -605,6 +605,15 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
aDesiredSize.maxElementSize->width += borderPadding.left + borderPadding.right;
aDesiredSize.maxElementSize->height += borderPadding.top + borderPadding.bottom;
}
// if we are constrained and the child is smaller, use the constrained values
if (aReflowState.HaveConstrainedWidth() && (aDesiredSize.width < aReflowState.minWidth)) {
aDesiredSize.width = aReflowState.minWidth;
}
if (aReflowState.HaveConstrainedHeight() && (aDesiredSize.height < aReflowState.minHeight)) {
aDesiredSize.height = aReflowState.minHeight;
}
aDesiredSize.ascent = aDesiredSize.height;
aDesiredSize.descent = 0;