Slightly better handling of left/right block margins

This commit is contained in:
kipp%netscape.com 1998-12-07 19:34:41 +00:00
Родитель 0a1dde9e7b
Коммит 44ab1f89b5
2 изменённых файлов: 4 добавлений и 4 удалений

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

@ -92,7 +92,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace,
mY = y; mY = y;
nsSize availSize(aSpace.width, aSpace.height); nsSize availSize(aSpace.width, aSpace.height);
if (NS_UNCONSTRAINEDSIZE != aSpace.width) { if (NS_UNCONSTRAINEDSIZE != aSpace.width) {
availSize.width -= mMargin.left; availSize.width -= mMargin.left + mMargin.right;
} }
if (NS_UNCONSTRAINEDSIZE != aSpace.height) { if (NS_UNCONSTRAINEDSIZE != aSpace.height) {
availSize.height -= mMargin.top + mMargin.bottom; 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 // margins this code is not yet complete. This code may need to
// move to before reflowing the frame instead of after (because // move to before reflowing the frame instead of after (because
// of floater positioning). // of floater positioning).
nscoord remainder = mSpace.XMost() - (x + mMetrics.width); nscoord remainder = mSpace.XMost() - (x + mMetrics.width + mMargin.right);
if (remainder >= 0) { if (remainder >= 0) {
// The block frame didn't use all of the available space. Apply // The block frame didn't use all of the available space. Apply
// auto margins. // auto margins.

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

@ -92,7 +92,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace,
mY = y; mY = y;
nsSize availSize(aSpace.width, aSpace.height); nsSize availSize(aSpace.width, aSpace.height);
if (NS_UNCONSTRAINEDSIZE != aSpace.width) { if (NS_UNCONSTRAINEDSIZE != aSpace.width) {
availSize.width -= mMargin.left; availSize.width -= mMargin.left + mMargin.right;
} }
if (NS_UNCONSTRAINEDSIZE != aSpace.height) { if (NS_UNCONSTRAINEDSIZE != aSpace.height) {
availSize.height -= mMargin.top + mMargin.bottom; 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 // margins this code is not yet complete. This code may need to
// move to before reflowing the frame instead of after (because // move to before reflowing the frame instead of after (because
// of floater positioning). // of floater positioning).
nscoord remainder = mSpace.XMost() - (x + mMetrics.width); nscoord remainder = mSpace.XMost() - (x + mMetrics.width + mMargin.right);
if (remainder >= 0) { if (remainder >= 0) {
// The block frame didn't use all of the available space. Apply // The block frame didn't use all of the available space. Apply
// auto margins. // auto margins.