From 35726078d4a358c5db6e00a2c60648999301742e Mon Sep 17 00:00:00 2001 From: "michaelp%netscape.com" Date: Sun, 26 Jul 1998 23:32:33 +0000 Subject: [PATCH] a tiny fix for scrollbars in scrolling views made without a widget association. git-svn-id: svn://10.0.0.236/trunk@6497 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsScrollingView.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mozilla/view/src/nsScrollingView.cpp b/mozilla/view/src/nsScrollingView.cpp index ee361b29ed5..845a46f2637 100644 --- a/mozilla/view/src/nsScrollingView.cpp +++ b/mozilla/view/src/nsScrollingView.cpp @@ -117,6 +117,18 @@ void ScrollBarView :: SetDimensions(nscoord width, nscoord height) } } +#if 0 +class nsICornerWidget : public nsISupports { +public: + NS_IMETHOD Init(nsIWidget* aParent, const nsRect& aBounds) = 0; + NS_IMETHOD MoveTo(PRInt32 aX, PRInt32 aY) = 0; + NS_IMETHOD Show() = 0; + NS_IMETHOD Hide() = 0; + NS_IMETHOD Start() = 0; + NS_IMETHOD Stop() = 0; +}; +#endif + class CornerView : public nsView { public: @@ -400,9 +412,9 @@ nsresult nsScrollingView :: Init(nsIViewManager* aManager, nsRect trect; trect.width = NS_TO_INT_ROUND(dx->GetScrollBarWidth()); - trect.x = aBounds.XMost() - trect.width; + trect.x = aBounds.x + aBounds.XMost() - trect.width; trect.height = NS_TO_INT_ROUND(dx->GetScrollBarHeight()); - trect.y = aBounds.YMost() - trect.height; + trect.y = aBounds.y + aBounds.YMost() - trect.height; rv = mCornerView->Init(mViewManager, trect, this, nsnull, nsnull, nsnull, -1, nsnull, 1.0f, nsViewVisibility_kHide); @@ -420,7 +432,7 @@ nsresult nsScrollingView :: Init(nsIViewManager* aManager, nsRect trect = aBounds; trect.width = NS_TO_INT_ROUND(dx->GetScrollBarWidth()); - trect.x = aBounds.XMost() - trect.width; + trect.x += aBounds.XMost() - trect.width; trect.height -= NS_TO_INT_ROUND(dx->GetScrollBarHeight()); static NS_DEFINE_IID(kCScrollbarIID, NS_VERTSCROLLBAR_CID); @@ -441,7 +453,7 @@ nsresult nsScrollingView :: Init(nsIViewManager* aManager, nsRect trect = aBounds; trect.height = NS_TO_INT_ROUND(dx->GetScrollBarHeight()); - trect.y = aBounds.YMost() - trect.height; + trect.y += aBounds.YMost() - trect.height; trect.width -= NS_TO_INT_ROUND(dx->GetScrollBarWidth()); static NS_DEFINE_IID(kCHScrollbarIID, NS_HORZSCROLLBAR_CID);