From 324f6729798851dcdb6d9b925b0fe4373863917e Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Fri, 30 Sep 2005 02:29:43 +0000 Subject: [PATCH] Don't use nsRect's operator== for comparisons where different sized empty rects should be treated as different. But 301411, r+sr=roc --- view/src/nsView.cpp | 6 +++++- view/src/nsViewManager.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp index e7889fdd2c8..af8666d5f24 100644 --- a/view/src/nsView.cpp +++ b/view/src/nsView.cpp @@ -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; } diff --git a/view/src/nsViewManager.cpp b/view/src/nsViewManager.cpp index 97f7a1a35e3..d471bb1eb3c 100644 --- a/view/src/nsViewManager.cpp +++ b/view/src/nsViewManager.cpp @@ -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;