Jelajahi Sumber

【fix】【测量】直线测量模式下,取消直线的选中,结果面板未刷新

tangchao 6 bulan lalu
induk
melakukan
b2d2eb87b5

+ 11 - 0
PDF Office/PDF Master/Class/PDFTools/Measure/Window/CDistanceMeasureInfoWindowController.swift

@@ -70,6 +70,17 @@ class CDistanceMeasureInfoWindowController: NSWindowController {
         self.measureInfo = measureInfo
         updateLabels()
     }
+    
+    func clearData() {
+        self.lengthLabel.stringValue = ""
+        self.angleLabel.stringValue = ""
+        self.xLabel.stringValue = ""
+        self.yLabel.stringValue = ""
+        
+        self.measureInfo = CPDFDistanceMeasureInfo()
+        
+        updateLabels()
+    }
         
     private func commonInit() {
         updateLabels()

+ 8 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -2743,6 +2743,14 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                         if (CAnnotationTypePolyLine == self.annotationType || CAnnotationTypePolyGon == self.annotationType || (CAnnotationTypeSquare == self.annotationType && CMeasureToolMode == self.toolMode)) {
                             
                         } else {
+                            if (((CPDFLineAnnotation *)self.activeAnnotation).isMeasure) {
+                                CPDFDistanceMeasureInfo *distanceMeasureInfo = [(CPDFLineAnnotation *)self.activeAnnotation measureInfo];
+                                [(CPDFLineAnnotation *)self.activeAnnotation setMeasureInfo:distanceMeasureInfo];
+                                if (self.pdfListViewDelegate && [self.pdfListViewDelegate respondsToSelector:@selector(PDFListViewAnnotationMeasureInfoChange:withAnnotation:)]) {
+                                    [self.pdfListViewDelegate PDFListViewAnnotationMeasureInfoChange:self withAnnotation:nil];
+                                }
+                            }
+                            
                             [self updateActiveAnnotations:@[]];
                             [self setNeedsDisplayAnnotationViewForPage:page];
                             break;

+ 11 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -1924,6 +1924,17 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
     }
     
     func pdfListViewAnnotationMeasureInfoChange(_ pdfListView: CPDFListView!, with annotation: CPDFAnnotation!) {
+        guard let data = annotation else {
+            if distanceMeasureInfoWindowController?.window?.isVisible == true {
+                distanceMeasureInfoWindowController?.clearData()
+            }
+//            else if perimeterMeasureInfoWindowController?.window?.isVisible == true {
+//                perimeterMeasureInfoWindowController?.hideFloatingWindow()
+//            } else if areaMeasureInfoWindowController?.window?.isVisible == true {
+//                areaMeasureInfoWindowController?.hideFloatingWindow()
+//            }
+            return
+        }
         if let lineAnnotation = annotation as? CPDFLineAnnotation {
             handleLineAnnotation(lineAnnotation)
         } else if let polylineAnnotation = annotation as? CPDFPolylineAnnotation {

+ 3 - 3
PDF Office/PDF Master/Class/Purchase/DMG/Verification/VerificationManager/VerificationManager.m

@@ -965,9 +965,9 @@ static VerificationManager *__verificationManager = nil;
 #if DEBUG
 @implementation VerificationManager (Test)
 
-//- (ActivityStatus)status {
-//    return ActivityStatusVerification;
-//}
+- (ActivityStatus)status {
+    return ActivityStatusVerification;
+}
 
 - (void)updateVerificationStatus {
     [self updateStatus:ActivityStatusVerification postNo:true];