Browse Source

【综合】图片旋转后,未刷新问题处理

niehaoyu 8 months ago
parent
commit
7efc1f411d

+ 7 - 7
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/StampList/KMAnnotationStampViewController.swift

@@ -437,6 +437,7 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
                 blockSelf.leftRotateBox.fillColor = KMAppearance.Layout.l1Color()
                 blockSelf.leftRotateImage.image = NSImage(named: KMImageNameUXIconPropertybarRotateCounterclockwiseNor)
             }
+            blockSelf.refreshSampleImage()
         }
         
         rightRotateBox.borderColor = KMAppearance.Interactive.s0Color()
@@ -471,6 +472,7 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
                 blockSelf.rightRotateBox.fillColor = KMAppearance.Layout.l1Color()
                 blockSelf.rightRotateImage.image = NSImage(named: KMImageNameUXIconPropertybarRotateClockwiseNor)
             }
+            blockSelf.refreshSampleImage()
         }
         
         contentTextView.wantsLayer = true
@@ -487,13 +489,7 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
         contentTextView.delegate = self
         contentTextView.isEditable = false
         
-        if annotationModel?.annotations != nil {
-            if annotation is CPDFListStampAnnotation {
-                sampleImageView.image = (annotationModel?.annotation as! CPDFListStampAnnotation).stampImage()
-            } else if annotation is CPDFListSignatureAnnotation {
-                sampleImageView.image = (annotationModel?.annotation as! CPDFListSignatureAnnotation).signImage
-            }
-        }
+        self.refreshSampleImage()
         
         if annotationModel?.annotations != nil {
             if annotation is CPDFListStampAnnotation {
@@ -888,6 +884,10 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
             }
         }
         
+        self.refreshSampleImage()
+    }
+    
+    private func refreshSampleImage() {
         if annotationModel?.annotations != nil {
             if annotation is CPDFListStampAnnotation {
                 sampleImageView.image = (annotationModel?.annotation as! CPDFListStampAnnotation).stampImage()