diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2012-03-01 08:54:02 +1100 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-03-01 08:54:02 +1100 |
commit | 7b2767f90c08c114ff85889323284ec6f709e13b (patch) | |
tree | 4fc23204348990c7d0f726556f733370f2dcc9be /cocoa/ScintillaView.mm | |
parent | 9c74efe984f4027ffb9ea6af58ed818ab5f2ff6c (diff) | |
download | scintilla-mirror-7b2767f90c08c114ff85889323284ec6f709e13b.tar.gz |
Enable basic pinch zoom. From Matthew Brush.
Diffstat (limited to 'cocoa/ScintillaView.mm')
-rw-r--r-- | cocoa/ScintillaView.mm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 0659eb2c2..2a3546b7b 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -638,6 +638,22 @@ NSString *SCIUpdateUINotification = @"SCIUpdateUI"; //-------------------------------------------------------------------------------------------------- /** + * Receives zoom messages, for example when a "pinch zoom" is performed on the trackpad. + */ +- (void) magnifyWithEvent: (NSEvent *) event +{ + 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]; +} + +//-------------------------------------------------------------------------------------------------- + +/** * Sends a new notification of the given type to the default notification center. */ - (void) sendNotification: (NSString*) notificationName |