Don't use nsRect's operator== for comparisons where different sized empty rects

should be treated as different.  But 301411, r+sr=roc
This commit is contained in:
bzbarsky%mit.edu 2005-09-30 02:29:43 +00:00
Родитель 2fba00fbd9
Коммит 324f672979
2 изменённых файлов: 10 добавлений и 2 удалений

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

@ -450,7 +450,11 @@ void nsView::SetDimensions(const nsRect& aRect, PRBool aPaint, PRBool aResizeWid
nsRect dims = aRect;
dims.MoveBy(mPosX, mPosY);
if (mDimBounds == dims) {
// Don't use nsRect's operator== here, since it returns true when
// both rects are empty even if they have different widths and we
// have cases where that sort of thing matters to us.
if (mDimBounds.TopLeft() == dims.TopLeft() &&
mDimBounds.Size() == dims.Size()) {
return;
}

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

@ -2870,7 +2870,11 @@ NS_IMETHODIMP nsViewManager::ResizeView(nsIView *aView, const nsRect &aRect, PRB
nsRect oldDimensions;
view->GetDimensions(oldDimensions);
if (oldDimensions != aRect) {
// Don't use nsRect's operator== here, since it returns true when
// both rects are empty even if they have different widths and we
// have cases where that sort of thing matters to us.
if (oldDimensions.TopLeft() != aRect.TopLeft() ||
oldDimensions.Size() != aRect.Size()) {
nsView* parentView = view->GetParent();
if (parentView == nsnull)
parentView = view;