From 644dbbc9d0098c02c8a1edd7d12daf13edca7eda Mon Sep 17 00:00:00 2001 From: Joren De Cuyper Date: Tue, 25 Feb 2014 23:10:44 +0100 Subject: 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 Tested-by: Norbert Thiebaud --- vcl/osx/salframeview.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index e52195732cae..e556bf38bb35 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; -- cgit