aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2012-03-01 08:54:02 +1100
committernyamatongwe <nyamatongwe@gmail.com>2012-03-01 08:54:02 +1100
commitdfca9098862bd6594fe0b5479eb455de8d766a97 (patch)
tree406024acc3348fc7c94d2b23392e625668122c29
parentc8a4fb3f2b0d7a8de134cc2fbb404c3b1f4f0342 (diff)
downloadscintilla-mirror-dfca9098862bd6594fe0b5479eb455de8d766a97.tar.gz
Enable basic pinch zoom. From Matthew Brush.
-rw-r--r--cocoa/ScintillaView.mm16
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