Correct child widget's view according to parent view's coordinates in AddCoveringWidgetsToOpaqueRegion. Fix for bug 73406. r=kmcclusk,sr=attinasi

This commit is contained in:
roc+%cs.cmu.edu 2001-03-31 13:41:28 +00:00
parent 36ce9910cd
commit 9b7ce382fd

View File

@ -1148,7 +1148,24 @@ static void AddCoveringWidgetsToOpaqueRegion(nsIRegion* aRgn, nsIDeviceContext*
nsRect bounds;
view->GetBounds(bounds);
if (bounds.width > 0 && bounds.height > 0) {
aRgn->Union(bounds.x, bounds.y, bounds.width, bounds.height);
nsIView* viewParent = nsnull;
view->GetParent(viewParent);
while (viewParent && viewParent != aRootView) {
nsRect parentBounds;
viewParent->GetBounds(parentBounds);
bounds.x += parentBounds.x;
bounds.y += parentBounds.y;
viewParent->GetParent(viewParent);
}
// maybe we couldn't get the view into the coordinate
// system of aRootView (maybe it's not a descendant
// view of aRootView?); if so, don't use it
if (viewParent) {
aRgn->Union(bounds.x, bounds.y, bounds.width, bounds.height);
}
}
}
}