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
Родитель 596cd15f00
Коммит 3bca354587
4 изменённых файлов: 28 добавлений и 4 удалений

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

@ -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) {

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

@ -135,6 +135,8 @@ public:
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
protected:
NS_IMETHOD AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aSuggestedReflowState);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
void GetTranslatedRect(nsRect& aRect);

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

@ -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) {

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

@ -135,6 +135,8 @@ public:
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
protected:
NS_IMETHOD AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aSuggestedReflowState);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
void GetTranslatedRect(nsRect& aRect);