From 4d4668dca4a6ffe3398f5c8a34e3c35a8be78b92 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Mon, 7 Dec 1998 19:34:41 +0000 Subject: [PATCH] Slightly better handling of left/right block margins --- layout/generic/nsBlockReflowContext.cpp | 4 ++-- layout/html/base/src/nsBlockReflowContext.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index 4a205d2e2a13..fed74b56e5e8 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -92,7 +92,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace, mY = y; nsSize availSize(aSpace.width, aSpace.height); if (NS_UNCONSTRAINEDSIZE != aSpace.width) { - availSize.width -= mMargin.left; + availSize.width -= mMargin.left + mMargin.right; } if (NS_UNCONSTRAINEDSIZE != aSpace.height) { availSize.height -= mMargin.top + mMargin.bottom; @@ -278,7 +278,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, PRBool aApplyTopMargin, // margins this code is not yet complete. This code may need to // move to before reflowing the frame instead of after (because // of floater positioning). - nscoord remainder = mSpace.XMost() - (x + mMetrics.width); + nscoord remainder = mSpace.XMost() - (x + mMetrics.width + mMargin.right); if (remainder >= 0) { // The block frame didn't use all of the available space. Apply // auto margins. diff --git a/layout/html/base/src/nsBlockReflowContext.cpp b/layout/html/base/src/nsBlockReflowContext.cpp index 4a205d2e2a13..fed74b56e5e8 100644 --- a/layout/html/base/src/nsBlockReflowContext.cpp +++ b/layout/html/base/src/nsBlockReflowContext.cpp @@ -92,7 +92,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace, mY = y; nsSize availSize(aSpace.width, aSpace.height); if (NS_UNCONSTRAINEDSIZE != aSpace.width) { - availSize.width -= mMargin.left; + availSize.width -= mMargin.left + mMargin.right; } if (NS_UNCONSTRAINEDSIZE != aSpace.height) { availSize.height -= mMargin.top + mMargin.bottom; @@ -278,7 +278,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, PRBool aApplyTopMargin, // margins this code is not yet complete. This code may need to // move to before reflowing the frame instead of after (because // of floater positioning). - nscoord remainder = mSpace.XMost() - (x + mMetrics.width); + nscoord remainder = mSpace.XMost() - (x + mMetrics.width + mMargin.right); if (remainder >= 0) { // The block frame didn't use all of the available space. Apply // auto margins.