bug 105166 - additional patch to place rounding code in the right place. sr=attinasi.

git-svn-id: svn://10.0.0.236/trunk@107535 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
karnaze%netscape.com
2001-11-07 02:38:49 +00:00
parent bfeea864ea
commit 7265213615
2 changed files with 16 additions and 18 deletions

View File

@@ -938,6 +938,14 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
if (aAvailWidth) {
availWidth = *aAvailWidth;
}
// work around pixel rounding errors, round down to ensure we don't exceed the avail height in
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
nscoord availHeight = aOuterRS.availableHeight;
if (NS_UNCONSTRAINEDSIZE != availHeight) {
availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown);
}
nsHTMLReflowState childRS(aPresContext, aOuterRS, aChildFrame,
nsSize(availWidth, aOuterRS.availableHeight));
childRS.reason = aReflowReason;
@@ -1469,15 +1477,6 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aOuterRS);
#endif
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
// work around pixel rounding errors, round down to ensure we don't exceed the avail height in
nscoord availHeight = aOuterRS.availableHeight;
if (NS_UNCONSTRAINEDSIZE != availHeight) {
availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown);
}
nsresult rv = NS_OK;
PRUint8 captionSide = GetCaptionSide();

View File

@@ -938,6 +938,14 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
if (aAvailWidth) {
availWidth = *aAvailWidth;
}
// work around pixel rounding errors, round down to ensure we don't exceed the avail height in
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
nscoord availHeight = aOuterRS.availableHeight;
if (NS_UNCONSTRAINEDSIZE != availHeight) {
availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown);
}
nsHTMLReflowState childRS(aPresContext, aOuterRS, aChildFrame,
nsSize(availWidth, aOuterRS.availableHeight));
childRS.reason = aReflowReason;
@@ -1469,15 +1477,6 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aOuterRS);
#endif
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
// work around pixel rounding errors, round down to ensure we don't exceed the avail height in
nscoord availHeight = aOuterRS.availableHeight;
if (NS_UNCONSTRAINEDSIZE != availHeight) {
availHeight = nsTableFrame::RoundToPixel(availHeight, p2t, eAlwaysRoundDown);
}
nsresult rv = NS_OK;
PRUint8 captionSide = GetCaptionSide();