summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa-cb/events_view.swift
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2020-01-22 17:04:33 +0100
committerder richter <der.richter@gmx.de>2020-01-26 12:33:47 +0100
commit1dea80d3fd836aa173bf4165d92f0da3511a462b (patch)
treec4bd81315b7193b4de6f63a2c6a92828a1058645 /video/out/cocoa-cb/events_view.swift
parent2aa4186a258d4d3829c3d072cd69b7c30f0c5eda (diff)
downloadmpv-1dea80d3fd836aa173bf4165d92f0da3511a462b.tar.bz2
mpv-1dea80d3fd836aa173bf4165d92f0da3511a462b.tar.xz
cocoa-cb: add pinch to resize window gesture
the event returns a delta ratio so we can just add it to the current window-scale. Adds support for #3214
Diffstat (limited to 'video/out/cocoa-cb/events_view.swift')
-rw-r--r--video/out/cocoa-cb/events_view.swift5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/cocoa-cb/events_view.swift b/video/out/cocoa-cb/events_view.swift
index 73ccba527f..124a7a028d 100644
--- a/video/out/cocoa-cb/events_view.swift
+++ b/video/out/cocoa-cb/events_view.swift
@@ -179,6 +179,11 @@ class EventsView: NSView {
}
}
+ override func magnify(with event: NSEvent) {
+ cocoaCB.layer?.inLiveResize = event.phase == .ended ? false : true
+ cocoaCB.window?.addWindowScale(Double(event.magnification))
+ }
+
func signalMouseDown(_ event: NSEvent) {
signalMouseEvent(event, MP_KEY_STATE_DOWN)
if event.clickCount > 1 {