Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
fix cells dragging on Sierra
Browse files Browse the repository at this point in the history
  • Loading branch information
stel committed Oct 6, 2016
1 parent 71e03de commit 0db8402
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions RealmTasks Apple/RealmTasks macOS/TaskCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,13 @@ extension TaskCellView: TaskTextFieldDelegate {
extension TaskCellView: NSGestureRecognizerDelegate {

func gestureRecognizerShouldBegin(gestureRecognizer: NSGestureRecognizer) -> Bool {
guard gestureRecognizer is NSPanGestureRecognizer else {
return false
}

let currentlyEditingTextField = ((window?.firstResponder as? NSText)?.delegate as? NSTextField)

guard let event = NSApp.currentEvent where currentlyEditingTextField != textView else {
guard currentlyEditingTextField != textView else {
return false
}

return fabs(event.deltaX) > fabs(event.deltaY)
return true
}

// FIXME: This could easily be refactored to avoid such a high CC.
Expand Down

0 comments on commit 0db8402

Please sign in to comment.