From d5af536078e28d03d4ddb93ce31bb937a2b153f4 Mon Sep 17 00:00:00 2001 From: "kmcclusk%netscape.com" Date: Fri, 12 Apr 2002 13:43:32 +0000 Subject: [PATCH] Fix off by one pixel scrolling errors running under 96DPI by replacing the damageRect.ScaleRoundOut(p2t) call with explicit conversion to twips because ScaleRoundOut introduced errors in the pixel to twips conversion. bug 120918; sr=attinasi r=dcone a=asa adt_a=paw git-svn-id: svn://10.0.0.236/trunk@118852 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsViewManager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 483f84b8f8a..caafcf3234b 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -689,12 +689,15 @@ void nsViewManager::Refresh(nsView *aView, nsIRenderingContext *aContext, nsIReg nsRect viewRect; aView->GetDimensions(viewRect); - nsRect damageRect = damageRectInPixels; + nsRect damageRect; nsRect paintRect; float p2t; mContext->GetDevUnitsToAppUnits(p2t); - damageRect.ScaleRoundOut(p2t); - + damageRect.x = NSToIntRound(damageRectInPixels.x * p2t); + damageRect.y = NSToIntRound(damageRectInPixels.y * p2t); + damageRect.width = NSToIntRound(damageRectInPixels.width * p2t); + damageRect.height = NSToIntRound(damageRectInPixels.height * p2t); + // move the view rect into widget coordinates viewRect.x = 0; viewRect.y = 0;