From a1dbc02252d2be5efd4cfdad96b26aae601558cc Mon Sep 17 00:00:00 2001 From: "michaelp%netscape.com" Date: Fri, 15 Jan 1999 22:11:46 +0000 Subject: [PATCH] when a clip is specified for a view, the clip now only affects the view for which it is specified, not any of it's children or other views stacked "behind" it. git-svn-id: svn://10.0.0.236/trunk@17871 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsView.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/mozilla/view/src/nsView.cpp b/mozilla/view/src/nsView.cpp index f371e83b7eb..39f086c8a3a 100644 --- a/mozilla/view/src/nsView.cpp +++ b/mozilla/view/src/nsView.cpp @@ -279,19 +279,11 @@ NS_IMETHODIMP nsView :: Paint(nsIRenderingContext& rc, const nsRect& rect, GetBounds(brect); - if ((mClip.mLeft != mClip.mRight) && (mClip.mTop != mClip.mBottom)) + if ((mClip.mLeft == mClip.mRight) || (mClip.mTop == mClip.mBottom) && + (this != pRoot)) { - nsRect crect; - - crect.x = mClip.mLeft + brect.x; - crect.y = mClip.mTop + brect.y; - crect.width = mClip.mRight - mClip.mLeft; - crect.height = mClip.mBottom - mClip.mTop; - - rc.SetClipRect(crect, nsClipCombine_kIntersect, clipres); - } - else if (this != pRoot) rc.SetClipRect(brect, nsClipCombine_kIntersect, clipres); + } } } @@ -581,6 +573,20 @@ NS_IMETHODIMP nsView :: Paint(nsIRenderingContext& rc, const nsRect& rect, if (NS_OK == mViewManager->GetViewObserver(obs)) { + if ((mClip.mLeft != mClip.mRight) && (mClip.mTop != mClip.mBottom)) + { + nsRect crect, brect; + + GetBounds(brect); + + crect.x = mClip.mLeft + brect.x; + crect.y = mClip.mTop + brect.y; + crect.width = mClip.mRight - mClip.mLeft; + crect.height = mClip.mBottom - mClip.mTop; + + localcx->SetClipRect(crect, nsClipCombine_kIntersect, clipres); + } + obs->Paint((nsIView *)this, *localcx, rect); NS_RELEASE(obs); }