From b7507c850a28626ca0fa6800b5df65d18bf3f056 Mon Sep 17 00:00:00 2001 From: "sharparrow1@yahoo.com" Date: Fri, 17 Aug 2007 13:30:23 -0700 Subject: [PATCH] Bug 382458, additional patch to fix repainting problems with theming and pixel rounding. r=vlad, a=blocking1.9+ --- gfx/thebes/src/gfxWindowsNativeDrawing.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gfx/thebes/src/gfxWindowsNativeDrawing.cpp b/gfx/thebes/src/gfxWindowsNativeDrawing.cpp index af5e0c0d8c2..068cece1aff 100644 --- a/gfx/thebes/src/gfxWindowsNativeDrawing.cpp +++ b/gfx/thebes/src/gfxWindowsNativeDrawing.cpp @@ -123,8 +123,12 @@ gfxWindowsNativeDrawing::BeginNativeDrawing() if (mTransformType == TRANSLATION_ONLY || !(mNativeDrawFlags & CAN_AXIS_ALIGNED_SCALE)) { mScale = gfxSize(1.0, 1.0); - mTempSurfaceSize.width = (PRInt32) NS_ceil(mNativeRect.size.width); - mTempSurfaceSize.height = (PRInt32) NS_ceil(mNativeRect.size.height); + // Add 1 to the surface size; it's guaranteed to not be incorrect, + // and it fixes bug 382458 + // There's probably a better fix, but I haven't figured out + // the root cause of the problem. + mTempSurfaceSize.width = (PRInt32) NS_ceil(mNativeRect.size.width + 1); + mTempSurfaceSize.height = (PRInt32) NS_ceil(mNativeRect.size.height + 1); } else { // figure out the scale factors mScale = m.ScaleFactors(PR_TRUE); @@ -136,8 +140,9 @@ gfxWindowsNativeDrawing::BeginNativeDrawing() mWorldTransform.eDx = 0.0f; mWorldTransform.eDy = 0.0f; - mTempSurfaceSize.width = (PRInt32) NS_ceil(mNativeRect.size.width * mScale.width); - mTempSurfaceSize.height = (PRInt32) NS_ceil(mNativeRect.size.height * mScale.height); + // See comment above about "+1" + mTempSurfaceSize.width = (PRInt32) NS_ceil(mNativeRect.size.width * mScale.width + 1); + mTempSurfaceSize.height = (PRInt32) NS_ceil(mNativeRect.size.height * mScale.height + 1); } } }