From 2cd262b882baab67dabc9b4e3b470231b5bace44 Mon Sep 17 00:00:00 2001 From: "sharparrow1%yahoo.com" Date: Thu, 28 Jun 2007 06:02:05 +0000 Subject: [PATCH] Bug 382595: SVG image is covered with horizonal lines when scrolled. r+sr=roc. git-svn-id: svn://10.0.0.236/trunk@228924 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsView.cpp | 2 +- mozilla/view/src/nsViewManager.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mozilla/view/src/nsView.cpp b/mozilla/view/src/nsView.cpp index c1ddaec1695..20ec62624f3 100644 --- a/mozilla/view/src/nsView.cpp +++ b/mozilla/view/src/nsView.cpp @@ -820,7 +820,7 @@ nsIWidget* nsIView::GetNearestWidget(nsPoint* aOffset) const // not coincide with v's origin if (aOffset) { nsRect vBounds = v->GetBounds(); - *aOffset = pt + v->GetPosition() - nsPoint(vBounds.x, vBounds.y) - + *aOffset = pt + v->GetPosition() - nsPoint(vBounds.x, vBounds.y) + v->ViewToWidgetOffset(); } return v->GetWidget(); diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index d73e3ab3ddf..533e6b8232c 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -847,6 +847,7 @@ NS_IMETHODIMP nsViewManager::UpdateView(nsIView *aView, const nsRect &aRect, PRU nsView* view = NS_STATIC_CAST(nsView*, aView); nsRect damagedRect(aRect); + NS_ASSERTION(damagedRect.IsEmpty() || view->GetDimensions().Contains(damagedRect),""); // If the rectangle is not visible then abort // without invalidating. This is a performance @@ -1939,7 +1940,9 @@ void nsViewManager::ViewToWidget(nsView *aView, nsView* aWidgetView, nsRect &aRe // account for the view's origin not lining up with the widget's aRect.x -= bounds.x; aRect.y -= bounds.y; - + + aRect += aView->ViewToWidgetOffset(); + // finally, convert to device coordinates. aRect.ScaleRoundOut(1.0f / mContext->AppUnitsPerDevPixel()); }