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
This commit is contained in:
parent
b21480c640
commit
a1dbc02252
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user