[Libreoffice-commits] core.git: vcl/osx

Joren De Cuyper jorendc at libreoffice.org
Wed Mar 5 07:22:39 PST 2014


 vcl/osx/salframeview.mm |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 644dbbc9d0098c02c8a1edd7d12daf13edca7eda
Author: Joren De Cuyper <jorendc at libreoffice.org>
Date:   Tue Feb 25 23:10:44 2014 +0100

    Switch to -magnification instead of -deltaZ for mac osx pinch-to-zoom
    
    Using pinch-to-zoom in LibreOffice result in following warning in terminal:
    soffice[2376:507] -deltaZ is deprecated for NSEventTypeMagnify.  Please use -magnification.
    
    Following https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/lMxCG03aZNs
    -deltaZ is deprecated since OSX 10.6. Therefore use -magnification. The forum also
    mentions the fact the steps are 500 times smaller. Lets use this factor 500 to keep the
    behavior as consistent as possible
    
    Change-Id: Ie769c518492e5b149a5301b19cae8d841047cb22
    Reviewed-on: https://gerrit.libreoffice.org/8345
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index e521957..e556bf3 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -765,11 +765,11 @@ private:
 
         if( bNewSeries )
             mfMagnifyDeltaSum = 0.0;
-        mfMagnifyDeltaSum += [pEvent deltaZ];
+        mfMagnifyDeltaSum += [pEvent magnification];
 
 		mfLastMagnifyTime = [pEvent timestamp];
 		// TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control
-		static const float fMagnifyFactor = 0.25;
+		static const float fMagnifyFactor = 0.25*500;
         static const float fMinMagnifyStep = 15.0 / fMagnifyFactor;
         if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep )
             return;


More information about the Libreoffice-commits mailing list