diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-29 17:05:26 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-29 17:05:26 +1000 |
commit | 795bb483f09755033a2180e9b6d6e19399b83c94 (patch) | |
tree | 11271452c94486eac47571ebcad39e149a45ec06 /cocoa/ScintillaView.mm | |
parent | 6e29cb833a42784e3cbcabfe8ab391e9499a6156 (diff) | |
download | scintilla-mirror-795bb483f09755033a2180e9b6d6e19399b83c94.tar.gz |
Decrease sensitivity of pinch-zoom. From Chinh Nguyen.
Diffstat (limited to 'cocoa/ScintillaView.mm')
-rw-r--r-- | cocoa/ScintillaView.mm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 3cdc612c7..68290f74d 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -643,16 +643,21 @@ NSString *SCIUpdateUINotification = @"SCIUpdateUI"; - (void) magnifyWithEvent: (NSEvent *) event { #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 - CGFloat z = [event magnification]; - - // Zoom out or in 1pt depending on sign of magnification event value (0.0 = no change) - if (z <= 0.0) - [ScintillaView directCall: self message: SCI_ZOOMOUT wParam: 0 lParam: 0]; - else if (z >= 0.0) - [ScintillaView directCall: self message: SCI_ZOOMIN wParam: 0 lParam: 0]; + zoomDelta += event.magnification * 10.0; + + if (fabsf(zoomDelta)>=1.0) { + long zoomFactor = [self getGeneralProperty: SCI_GETZOOM] + zoomDelta; + [self setGeneralProperty: SCI_SETZOOM parameter: zoomFactor value:0]; + zoomDelta = 0.0; + } #endif } +- (void) beginGestureWithEvent: (NSEvent *) event +{ + zoomDelta = 0.0; +} + //-------------------------------------------------------------------------------------------------- /** |