X-Git-Url: https://git.r.bdr.sh/rbdr/captura/blobdiff_plain/cdc79b7d7c4829ba7a0371826b28f398f267c46a..refs/heads/rbdr-multimonitor:/Captura/CapturaApp.swift?ds=sidebyside diff --git a/Captura/CapturaApp.swift b/Captura/CapturaApp.swift index 0d22e79..00c5cc4 100644 --- a/Captura/CapturaApp.swift +++ b/Captura/CapturaApp.swift @@ -132,9 +132,14 @@ struct CapturaApp: App { func menuWillOpen(_ menu: NSMenu) { if captureState != .idle { - menu.cancelTracking() + menu.cancelTrackingWithoutAnimation() + if captureState == .selectingArea { + NotificationCenter.default.post(name: .startRecording, object: nil, userInfo: nil) + return + } if captureState == .recording { NotificationCenter.default.post(name: .stopRecording, object: nil, userInfo: nil) + return } } } @@ -326,7 +331,10 @@ struct CapturaApp: App { if now - gifCallbackTimer > .nanoseconds(1_000_000_000 / UInt64(captureSessionConfiguration.frameRate)) { gifCallbackTimer = now DispatchQueue.main.async { - if let cgImage = frame.cgImage?.resize(by: self.pixelDensity) { + if var cgImage = frame.cgImage { + if self.pixelDensity > 1 { + cgImage = cgImage.resize(by: self.pixelDensity) ?? cgImage + } self.images.append(cgImage) } }