uses the new factored code for calculating size it helps for calculating suggested size

(see nsGfxButtonControlFrame.cpp)
This commit is contained in:
rods@netscape.com
1999-08-31 13:05:31 +00:00
parent 75cba99319
commit 4c038869af
4 changed files with 28 additions and 4 deletions

View File

@@ -409,6 +409,15 @@ void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage)
}
}
NS_IMETHODIMP
nsHTMLButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aSuggestedReflowState)
{
aDesiredSize.width += aSuggestedReflowState.mComputedBorderPadding.left + aSuggestedReflowState.mComputedBorderPadding.right;
aDesiredSize.height += aSuggestedReflowState.mComputedBorderPadding.top + aSuggestedReflowState.mComputedBorderPadding.bottom;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@@ -514,8 +523,9 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
else
aDesiredSize.height += focusPadding.top + focusPadding.bottom;
aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom;
AddComputedBorderPaddingToDesiredSize(aDesiredSize, aReflowState);
//aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;
//aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom;
//adjust our max element size, if necessary
if (aDesiredSize.maxElementSize) {