Fix some scrolling anomolies. This fixes bug #10058.

git-svn-id: svn://10.0.0.236/trunk@39885 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blizzard%redhat.com
1999-07-17 17:24:04 +00:00
parent be8479149c
commit 51004e5cb3
3 changed files with 9 additions and 14 deletions

View File

@@ -73,8 +73,6 @@ nsWidget::nsWidget() : nsBaseWidget()
mGC = 0;
mParentWidget = nsnull;
mName = "unnamed";
mScrollX = 0;
mScrollY = 0;
mIsShown = PR_FALSE;
mIsToplevel = PR_FALSE;
mIsMapped = PR_FALSE;
@@ -409,9 +407,11 @@ NS_IMETHODIMP nsWidget::Show(PRBool bState)
NS_IMETHODIMP nsWidget::IsVisible(PRBool &aState)
{
if (mIsMapped && (mVisibility != VisibilityFullyObscured)) {
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWidget::IsVisible: yes\n"));
aState = PR_TRUE;
}
else {
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWidget::IsVisible: no\n"));
aState = PR_FALSE;
}
return NS_OK;
@@ -943,12 +943,12 @@ void nsWidget::WidgetShow(nsWidget *aWidget)
PRBool nsWidget::WidgetVisible(nsRect &aBounds)
{
nsRect mScrollArea;
mScrollArea.x = mScrollX;
mScrollArea.y = mScrollY;
mScrollArea.width = mBounds.width + mScrollX;
mScrollArea.height = mBounds.height + mScrollY;
if (mScrollArea.Intersects(aBounds)) {
nsRect scrollArea;
scrollArea.x = 0;
scrollArea.y = 0;
scrollArea.width = mBounds.width;
scrollArea.height = mBounds.height;
if (scrollArea.Intersects(aBounds)) {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("nsWidget::WidgetVisible(): widget is visible\n"));
return PR_TRUE;
}

View File

@@ -151,9 +151,6 @@ protected:
// check to see whether or not a rect will intersect with the current scrolled area
PRBool WidgetVisible (nsRect &aBounds);
PRUint32 mScrollX;
PRUint32 mScrollY;
PRBool mIsShown;
PRBool mIsMapped;
int mVisibility; // this is an int because that's the way X likes it

View File

@@ -131,7 +131,7 @@ NS_IMETHODIMP nsWindow::Invalidate(const nsRect & aRect, PRBool aIsSynchronous)
NS_IMETHODIMP nsWindow::Update()
{
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWindow::Update()\n"));
//PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWindow::Update()\n"));
nsPaintEvent pevent;
pevent.message = NS_PAINT;
@@ -151,8 +151,6 @@ NS_IMETHODIMP nsWindow::Update()
NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
{
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("nsWindow::Scroll()\n"));
mScrollX += aDx;
mScrollY += aDy;
//--------
// Scroll the children