Changed MoveViewTo() so it doesn't do any painting unless the

origin actually changes
This commit is contained in:
troy%netscape.com 1998-07-23 04:21:05 +00:00
parent 804683723f
commit 448077e579

View File

@ -685,15 +685,18 @@ void nsViewManager :: MoveViewTo(nsIView *aView, nscoord aX, nscoord aY)
// only do damage control if the view is visible // only do damage control if the view is visible
if (nsViewVisibility_kHide != aView->GetVisibility()) if ((aX != oldX) || (aY != oldY))
{ {
nsRect bounds; if (nsViewVisibility_kHide != aView->GetVisibility())
aView->GetBounds(bounds); {
nsRect oldArea(oldX, oldY, bounds.width, bounds.height); nsRect bounds;
nsIView* parent = aView->GetParent(); // no addref aView->GetBounds(bounds);
UpdateView(parent, oldArea, 0); nsRect oldArea(oldX, oldY, bounds.width, bounds.height);
nsRect newArea(aX, aY, bounds.width, bounds.height); nsIView* parent = aView->GetParent(); // no addref
UpdateView(parent, newArea, 0); UpdateView(parent, oldArea, 0);
nsRect newArea(aX, aY, bounds.width, bounds.height);
UpdateView(parent, newArea, 0);
}
} }
} }