소스 검색

【综合】整理代码

tangchao 11 달 전
부모
커밋
e6c75b007a

+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/Table/KMTableAnnotation.swift

@@ -41,7 +41,7 @@ class KMTableAnnotation: CPDFInkAnnotation, NSTextViewDelegate {
     let MinCellWidth: CGFloat = 10.0
     let MinCellHeight: CGFloat = 10.0
     
-    var pdfView: CPDFListView = CPDFListView()
+    weak var pdfView: CPDFListView?
 
     deinit {
         KMPrint("KMTableAnnotation 释放")
@@ -479,7 +479,7 @@ class KMTableAnnotation: CPDFInkAnnotation, NSTextViewDelegate {
                                     rect.origin.y + self.bounds.origin.y - 4,
                                     rect.size.width, rect.size.height)
             
-            let newRect = self.pdfView.convert(bounds, from: self.page)
+            let newRect = self.pdfView?.convert(bounds, from: self.page) ?? .zero
             
             self.currentCell = self.cellData(with: point)
             let cell = self.rowDataList[currentCell.row][currentCell.column]
@@ -1563,7 +1563,7 @@ class KMTableAnnotation: CPDFInkAnnotation, NSTextViewDelegate {
             if let textColor = self.textView?.textColor {
                 cell.textColor = textColor
             }
-            cell.font = NSFont(name: (self.textView?.font!.fontName)!, size: CGFloat((self.textView?.font!.pointSize)!/self.pdfView.scaleFactor))!
+            cell.font = NSFont(name: (self.textView?.font!.fontName)!, size: CGFloat((self.textView?.font!.pointSize)!/(self.pdfView?.scaleFactor ?? 1)))!
             
             let path: NSBezierPath?
             path = self.crossLines[self.rowNumber - row - 1]
@@ -1573,7 +1573,7 @@ class KMTableAnnotation: CPDFInkAnnotation, NSTextViewDelegate {
 //                self.moveCrossLineOfIndex(index, withDistance: y)
             }
             self.afreshDrawLine()
-            self.pdfView.needsDisplay = true
+            self.pdfView?.needsDisplay = true
         }
     }
 

+ 4 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Extension.m

@@ -330,9 +330,12 @@ CGFloat DEFAULT_SNAPSHOT_HEIGHT = 200.0;
         [table createFormWithRow:4 andColumn:4];
         [self addAnnotation:table toPage:page];
         [table registerUserName];
-        [self setActiveAnnotations:[NSMutableArray arrayWithArray:@[table]]];
+//        [self setActiveAnnotations:[NSMutableArray arrayWithArray:@[table]]];
+        [self updateActiveAnnotations:[NSMutableArray arrayWithArray:@[table]]];
+//        [self setNeedsDisplayAnnotation:table];
         
         [table drawLineWithPoint:CGPointMake(NSMinX(bounds) + 10, NSMaxY(bounds) - 10)];
+        [self setNeedsDisplayAnnotation:table];
         [[NSNotificationCenter defaultCenter] postNotificationName:@"KMPDFViewActiveAnnotationDidChangeNotification" object:self];
 
         [[NSNotificationCenter defaultCenter] postNotificationName:KMPDFViewTableAnnotationDidChangeNotification object:self userInfo:@{@"point":[NSValue valueWithPoint:CGPointMake(NSMinX(bounds) + 10, NSMaxY(bounds) - 10)]}];

+ 16 - 0
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -292,5 +292,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "E06F8A0A-EE27-420D-9CFD-732FE4967253"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/AppDelegate.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "11"
+            endingLineNumber = "11"
+            landmarkName = "AppDelegate"
+            landmarkType = "3">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>