Fixed html and input button to center and size correctly. #17474,#17353,#23270, #21249 -r Rod

git-svn-id: svn://10.0.0.236/trunk@58111 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
evaughan%netscape.com
2000-01-18 20:29:22 +00:00
parent edf692ebd0
commit 03c87d94d3
7 changed files with 33 additions and 9 deletions

View File

@@ -619,10 +619,19 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext* aPresContext,
focusPadding.top + aReflowState.mComputedBorderPadding.top,
0, aStatus);
// center child vertically
nscoord yoff = 0;
if (aReflowState.mComputedHeight != NS_INTRINSICSIZE) {
yoff = (aReflowState.mComputedHeight - aDesiredSize.height)/2;
if (yoff < 0)
yoff = 0;
}
// Place the child
FinishReflowChild(firstKid, aPresContext, aDesiredSize,
focusPadding.left + aReflowState.mComputedBorderPadding.left,
focusPadding.top + aReflowState.mComputedBorderPadding.top, 0);
yoff + focusPadding.top + aReflowState.mComputedBorderPadding.top, 0);
#if 0 // old way
// if computed use the computed values.