Browse Source

页面编辑-复制页面后,当未选中任何页面,此时粘贴的位置在哪?(已修复)

tangchao 1 year ago
parent
commit
fa26da2286

BIN
PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
PDF Office/PDF Office.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -318,8 +318,8 @@
             filePath = "PDF Office/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1568"
-            endingLineNumber = "1568"
+            startingLineNumber = "1572"
+            endingLineNumber = "1572"
             landmarkName = "thumbnailView(thumbanView:itemForRepresentedObjectAt:)"
             landmarkType = "7">
             <Locations>

+ 1 - 1
PDF Office/PDF Office/Class/KMLightMember/Controller/Login&Register/KMLoginWindowController.swift

@@ -217,8 +217,8 @@ class KMLoginWindowController: NSWindowController {
                 if success {
                     KMRequestServerManager.manager.getUserInfo { success, data, error, isLocal in
                         if success {
-                            loginMainWindow?.endSheet(view.window!)
                             view.window!.close()
+                            loginMainWindow?.endSheet(view.window!)
                             loginWindowController = nil
                             loginMainWindow = nil
                         }

+ 5 - 1
PDF Office/PDF Office/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -278,6 +278,10 @@ class KMPDFEditViewController: NSViewController {
                 if (self.documentEditedCallback != nil) {
                     self.documentEditedCallback!()
                 }
+                
+                var indexpaths: Set<IndexPath> = []
+                indexpaths.insert(IndexPath(item: index, section: 0))
+                self.thumbnailView.collectionView.animator().scrollToItems(at: indexpaths, scrollPosition: .top)
             }
         }
     }
@@ -1603,7 +1607,7 @@ extension KMPDFEditViewController: KMEditMenuProtocol {
     }
     
     @IBAction func paste(_ sender: Any) {
-        var index: Int = 0
+        var index: Int = Int(self.thumbnailView.document.pageCount-1)
         let indexSet = self.thumbnailView.collectionView.selectionIndexes
         if (indexSet.isEmpty == false) {
             index = indexSet.last!

+ 1 - 3
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -408,9 +408,7 @@ import Cocoa
         DispatchQueue.main.async {
             for i in 0 ..< self.listView.document.pageCount {
                 let page = self.listView.document.page(at: i)
-                for annotation in page!.annotations {
-                    page?.removeAnnotation(annotation)
-                }
+                page?.removeAllAnnotations()
             }
             self.listView.setNeedsDisplayForVisiblePages()
         }