From f8f28ae91d9a57fdf9d39105ea5537fc7e95fa84 Mon Sep 17 00:00:00 2001 From: Douglas Mencken Date: Sun, 30 Mar 2014 08:52:41 -0400 Subject: [PATCH] vcl-osx fix: 'NSEvent' may not respond to '-magnification' (error: invalid operands of types 'float' and 'objc_object*' to binary 'operator+') Change-Id: Iade7acde31fad21d7dde1a8c20c8900d9cbbd446 Reviewed-on: https://gerrit.libreoffice.org/8792 Tested-by: Norbert Thiebaud Reviewed-by: Norbert Thiebaud --- vcl/osx/salframeview.mm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index e556bf38bb35..d44411fb56f2 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -765,11 +765,19 @@ private: if( bNewSeries ) mfMagnifyDeltaSum = 0.0; +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 + mfMagnifyDeltaSum += [pEvent deltaZ]; +#else mfMagnifyDeltaSum += [pEvent magnification]; +#endif - mfLastMagnifyTime = [pEvent timestamp]; - // TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control - static const float fMagnifyFactor = 0.25*500; + mfLastMagnifyTime = [pEvent timestamp]; +// TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 + static const float fMagnifyFactor = 0.25; +#else + static const float fMagnifyFactor = 0.25*500; // steps are 500 times smaller for -magnification +#endif static const float fMinMagnifyStep = 15.0 / fMagnifyFactor; if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep ) return;