Kaydet (Commit) 644dbbc9 authored tarafından Joren De Cuyper's avatar Joren De Cuyper Kaydeden (comit) Norbert Thiebaud

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/8345Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
Tested-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst 160d2895
...@@ -765,11 +765,11 @@ private: ...@@ -765,11 +765,11 @@ private:
if( bNewSeries ) if( bNewSeries )
mfMagnifyDeltaSum = 0.0; mfMagnifyDeltaSum = 0.0;
mfMagnifyDeltaSum += [pEvent deltaZ]; mfMagnifyDeltaSum += [pEvent magnification];
mfLastMagnifyTime = [pEvent timestamp]; mfLastMagnifyTime = [pEvent timestamp];
// TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control // 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; static const float fMinMagnifyStep = 15.0 / fMagnifyFactor;
if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep ) if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep )
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment