From 7efa97848323dc678a93d33a6b6a6abb4fc1e686 Mon Sep 17 00:00:00 2001 From: "kmcclusk%netscape.com" Date: Tue, 10 Aug 1999 22:20:53 +0000 Subject: [PATCH] Added code to prevent negative values from being passed to nsIWidget::Resize. git-svn-id: svn://10.0.0.236/trunk@43046 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsScrollingView.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mozilla/view/src/nsScrollingView.cpp b/mozilla/view/src/nsScrollingView.cpp index 3f795beb0de..5970f5a337d 100644 --- a/mozilla/view/src/nsScrollingView.cpp +++ b/mozilla/view/src/nsScrollingView.cpp @@ -471,7 +471,7 @@ NS_IMETHODIMP nsScrollingView::SetDimensions(nscoord width, nscoord height, PRBo showVert = NSToCoordRound(scrollWidth); // Compute the clip view rect - clipRect.SetRect(0, 0, width - showVert, height - showHorz); + clipRect.SetRect(0, 0, PR_MAX((width - showVert), 0), PR_MAX((height - showHorz), 0)); clipRect.Deflate(mInsets); // Size and position the clip view @@ -1088,11 +1088,15 @@ NS_IMETHODIMP nsScrollingView::ComputeScrollOffsets(PRBool aAdjustWidgets) // Adjust the size of the clip view to account for scrollbars that are // showing - if (mHScrollBarView && ViewIsShowing((ScrollBarView *)mHScrollBarView)) + if (mHScrollBarView && ViewIsShowing((ScrollBarView *)mHScrollBarView)) { controlRect.height -= hheight; + controlRect.height = PR_MAX(controlRect.height, 0); + } - if (mVScrollBarView && ViewIsShowing((ScrollBarView *)mVScrollBarView)) + if (mVScrollBarView && ViewIsShowing((ScrollBarView *)mVScrollBarView)) { controlRect.width -= vwidth; + controlRect.width = PR_MAX(controlRect.width, 0); + } mClipView->SetDimensions(controlRect.width, controlRect.height, PR_FALSE);