Просмотр исходного кода

综合 - 修复【历史文件】取消选中的区域判断

wanjun 2 лет назад
Родитель
Сommit
1eef47624f

+ 15 - 3
PDF Office/PDF Office/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -491,9 +491,21 @@ extension KMHomeViewController {
     
     override func otherMouseDown(with event: NSEvent) {
         if historyFileViewController.selectFiles.count > 0 {
-            let point = event.locationInWindow
-            if historyFileViewController.view.frame.contains(point) {
-                
+            let eventPoint = event.locationInWindow as NSPoint
+            let x = eventPoint.x - 270.0
+            if x >= 0 {
+                let point = NSPoint(x: x, y: eventPoint.y)
+                if historyFileViewController.historyFileCollectionView.frame.contains(point) ||
+                    historyFileViewController.historyFileTableView.frame.contains(point) {
+                    
+                } else {
+                    self.historyFileViewController.selectFiles.removeAll()
+                    if self.historyFileViewController.showMode == .Thumbnail {
+                        self.historyFileViewController.historyFileCollectionView.reloadData()
+                    } else {
+                        self.historyFileViewController.historyFileTableView.reloadData()
+                    }
+                }
             } else {
                 self.historyFileViewController.selectFiles.removeAll()
                 if self.historyFileViewController.showMode == .Thumbnail {