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.
This commit is contained in:
michaelp%netscape.com 1999-01-15 22:11:46 +00:00
Родитель 6bc95bee70
Коммит 531901380e
1 изменённых файлов: 17 добавлений и 11 удалений

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

@ -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);
}