Bug 549630. mViewToWidgetOffset is being calculated the wrong way around. r=mats
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 10 Mar 2010 13:14:17 +1300
changeset 39432 def0545f8384f175c938a5216b713cf3e50e0966
parent 39431 58864f51e68e38ec5c25bc61c894a598306c51fb
child 39433 20a2dea77cd367a40a88412de9a1e55878219949
push idunknown
push userunknown
push dateunknown
reviewersmats
bugs549630
milestone1.9.3a3pre
Bug 549630. mViewToWidgetOffset is being calculated the wrong way around. r=mats
nsprpub/configure
view/src/nsView.cpp
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -6123,17 +6123,17 @@ trap 'rm -f $CONFIG_STATUS conftest*; ex
 # Protect against Makefile macro expansion.
 cat > conftest.defs <<\EOF
 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
 s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
 s%\[%\\&%g
 s%\]%\\&%g
 s%\$%$$%g
 EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' ' | tr '\015' ' '` # Manually modified for MKS support.
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
 rm -f conftest.defs
 
 
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
 rm -f $CONFIG_STATUS
--- a/view/src/nsView.cpp
+++ b/view/src/nsView.cpp
@@ -359,17 +359,18 @@ nsIntRect nsIView::CalcWidgetBounds(nsWi
                             NSIntPixelsToAppUnits(screenPoint.y, p2a));
     }
   }
 
   nsIntRect newBounds = viewBounds.ToNearestPixels(p2a);
 
   nsPoint roundedOffset(NSIntPixelsToAppUnits(newBounds.x, p2a),
                         NSIntPixelsToAppUnits(newBounds.y, p2a));
-  mViewToWidgetOffset = viewBounds.TopLeft() - roundedOffset;
+  // mViewToWidgetOffset is added to view coordinates to get widget coordinates
+  mViewToWidgetOffset = roundedOffset - viewBounds.TopLeft();
 
   return newBounds;
 }
 
 void nsView::DoResetWidgetBounds(PRBool aMoveOnly,
                                  PRBool aInvalidateChangedSize) {
   // The geometry of a root view's widget is controlled externally,
   // NOT by sizing or positioning the view