Explorar o código

PDFAnnotation(iOS) - UI调整

dinglingui hai 1 ano
pai
achega
d2f86876fa

+ 0 - 16
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -218,8 +218,6 @@
 		F38F5B602A0344EA00D0EEFD /* CPDFListView+Annotation.h in Headers */ = {isa = PBXBuildFile; fileRef = F38F5B5E2A0344EA00D0EEFD /* CPDFListView+Annotation.h */; };
 		F38F5B612A0344EA00D0EEFD /* CPDFListView+Annotation.m in Sources */ = {isa = PBXBuildFile; fileRef = F38F5B5F2A0344EA00D0EEFD /* CPDFListView+Annotation.m */; };
 		F38F5B632A038B0400D0EEFD /* CPDFListView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = F38F5B622A038B0400D0EEFD /* CPDFListView+Private.h */; };
-		F38F5B672A03D68100D0EEFD /* CPDFListMagnifierView.m in Sources */ = {isa = PBXBuildFile; fileRef = F38F5B652A03D68100D0EEFD /* CPDFListMagnifierView.m */; };
-		F38F5B682A03D68100D0EEFD /* CPDFListMagnifierView.h in Headers */ = {isa = PBXBuildFile; fileRef = F38F5B662A03D68100D0EEFD /* CPDFListMagnifierView.h */; };
 		F38F60C629EFF0C2008098F8 /* CPDFColorUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = F38F60C429EFF0C1008098F8 /* CPDFColorUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		F38F60C729EFF0C2008098F8 /* CPDFColorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F38F60C529EFF0C1008098F8 /* CPDFColorUtils.m */; };
 		F3DF83D42A0BB9BA00D4F3AF /* CStringConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = F3DF83D22A0BB9BA00D4F3AF /* CStringConstants.h */; };
@@ -461,8 +459,6 @@
 		F38F5B5E2A0344EA00D0EEFD /* CPDFListView+Annotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CPDFListView+Annotation.h"; sourceTree = "<group>"; };
 		F38F5B5F2A0344EA00D0EEFD /* CPDFListView+Annotation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "CPDFListView+Annotation.m"; sourceTree = "<group>"; };
 		F38F5B622A038B0400D0EEFD /* CPDFListView+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CPDFListView+Private.h"; sourceTree = "<group>"; };
-		F38F5B652A03D68100D0EEFD /* CPDFListMagnifierView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPDFListMagnifierView.m; sourceTree = "<group>"; };
-		F38F5B662A03D68100D0EEFD /* CPDFListMagnifierView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFListMagnifierView.h; sourceTree = "<group>"; };
 		F38F60C429EFF0C1008098F8 /* CPDFColorUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFColorUtils.h; sourceTree = "<group>"; };
 		F38F60C529EFF0C1008098F8 /* CPDFColorUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFColorUtils.m; sourceTree = "<group>"; };
 		F3DF83D22A0BB9BA00D4F3AF /* CStringConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CStringConstants.h; sourceTree = "<group>"; };
@@ -1044,7 +1040,6 @@
 			isa = PBXGroup;
 			children = (
 				F35DD18C2A06850700B57F5B /* PDFKit Categories */,
-				F38F5B642A03D64C00D0EEFD /* PDFListMagnifierView */,
 				F382636529EFD0D8003F1DFD /* PDFListView */,
 				F382635E29EFD0D8003F1DFD /* PDFPageIndicatorView */,
 				F382636129EFD0D8003F1DFD /* PDFSliderView */,
@@ -1156,15 +1151,6 @@
 			path = PDFListView;
 			sourceTree = "<group>";
 		};
-		F38F5B642A03D64C00D0EEFD /* PDFListMagnifierView */ = {
-			isa = PBXGroup;
-			children = (
-				F38F5B662A03D68100D0EEFD /* CPDFListMagnifierView.h */,
-				F38F5B652A03D68100D0EEFD /* CPDFListMagnifierView.m */,
-			);
-			path = PDFListMagnifierView;
-			sourceTree = "<group>";
-		};
 		F3F5EE7029E69B2A0081CB32 /* Recovered References */ = {
 			isa = PBXGroup;
 			children = (
@@ -1207,7 +1193,6 @@
 				C9AF189229F4D0F300EC4979 /* CPDFAnnotationSampleView.h in Headers */,
 				C918CEE329FBA41A00D43974 /* CPDFDrawArrowView.h in Headers */,
 				4F06AB5429F6792E007797E4 /* CPDFTextProperty.h in Headers */,
-				F38F5B682A03D68100D0EEFD /* CPDFListMagnifierView.h in Headers */,
 				F382636B29EFD0D9003F1DFD /* CPDFSlider.h in Headers */,
 				4FD34DD82A0B44A1005CEAB6 /* UIView+Extension.h in Headers */,
 				4FD34DD02A0B3F51005CEAB6 /* CPDFPopMenu.h in Headers */,
@@ -1390,7 +1375,6 @@
 				C9FBA2172A0D11C7003FABEC /* CStampFileManger.m in Sources */,
 				F32DA17F29ED904300E19ECA /* CNavigationController.m in Sources */,
 				F382636D29EFD0D9003F1DFD /* CPDFListView.m in Sources */,
-				F38F5B672A03D68100D0EEFD /* CPDFListMagnifierView.m in Sources */,
 				C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */,
 				F32DA17329ED904300E19ECA /* CPDFThumbnailViewController.m in Sources */,
 				C91BE7C42A02352B0038F2BC /* CPDFFreeTextViewController.m in Sources */,

+ 2 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m

@@ -242,11 +242,11 @@
             }
         }
     }
-    [self.navigationController popViewControllerAnimated:YES];
+    [self buttonItemClicked_Cancel:sender];
 }
 
 - (void)buttonItemClicked_Cancel:(id)sender {
-    [self.navigationController popViewControllerAnimated:YES];
+    [self dismissViewControllerAnimated:YES completion:nil];
 }
 
 - (void)buttonItemClicked_create:(id)sender {

+ 2 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.h

@@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @optional
 
+- (void)signatureViewControllerDismiss:(CPDFSignatureViewController *)signatureViewController;
+
 - (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController;
 
 - (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController image:(UIImage *)image;

+ 6 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m

@@ -133,11 +133,15 @@
 #pragma mark - Action
 
 - (void)buttonItemClicked_back:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
+    [self dismissViewControllerAnimated:YES completion:^{
+        if([self.delegate performSelector:@selector(signatureViewControllerDismiss:)]) {
+            [self.delegate signatureViewControllerDismiss:self];
+        }
+    }];
 }
 
 - (void)buttonItemClicked_create:(id)sender {
-    [self dismissViewControllerAnimated:YES completion:nil];
+    [self dismissViewControllerAnimated:NO completion:nil];
     if (self.delegate && [self.delegate respondsToSelector:@selector(signatureViewController:)]) {
         [self.delegate signatureViewController:self];
     }

+ 5 - 2
compdfkit-tools/compdfkit-tools/Common/Model/CAnnotStyle.m

@@ -266,7 +266,7 @@
                 color = [userDefaults PDFListViewColorForKey:CArrowNoteColorKey];
                 break;
             case CPDFViewAnnotationModeInk:
-                color = [userDefaults PDFListViewColorForKey:CInkNoteColorKey];
+                color = [CPDFKitConfig sharedInstance].freehandAnnotationColor;
                 break;
             default:
                 break;
@@ -311,6 +311,7 @@
                 [userDefaults setPDFListViewColor:color forKey:CArrowNoteColorKey];
                 break;
             case CPDFViewAnnotationModeInk:
+                [[CPDFKitConfig sharedInstance] setFreehandAnnotationColor:color];
                 [userDefaults setPDFListViewColor:color forKey:CInkNoteColorKey];
                 break;
             default:
@@ -358,7 +359,7 @@
                 opacity = [userDefaults floatForKey:CArrowNoteOpacityKey];
                 break;
             case CPDFViewAnnotationModeInk:
-                opacity = [userDefaults floatForKey:CInkNoteOpacityKey];
+                opacity = [CPDFKitConfig sharedInstance].freehandAnnotationOpacity;
                 break;
             default:
                 break;
@@ -406,6 +407,8 @@
                 [userDefaults setFloat:opacity forKey:CArrowNoteOpacityKey];
                 break;
             case CPDFViewAnnotationModeInk:
+                [[CPDFKitConfig sharedInstance] setFreehandAnnotationOpacity:opacity];
+
                 [userDefaults setFloat:opacity forKey:CInkNoteOpacityKey];
                 break;
             default:

+ 23 - 9
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -243,7 +243,12 @@
 
 - (void)updatePropertiesButtonState {
     if(CPDFViewAnnotationModeNone != self.pdfListView.annotationMode || self.annotManage.pdfListView.activeAnnotations.count > 0) {
-        self.propertiesBtn.enabled = YES;
+        CPDFAnnotation *annotation = self.annotManage.pdfListView.activeAnnotations.firstObject;
+        if([annotation isKindOfClass:[CPDFStampAnnotation class]] || [annotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
+            self.propertiesBtn.enabled = NO;
+        } else {
+            self.propertiesBtn.enabled = YES;
+        }
     } else {
         self.propertiesBtn.enabled = NO;
     }
@@ -420,6 +425,7 @@
     if (CPDFViewAnnotationModeInk == self.selectedIndex) {
         [CPDFKitConfig  sharedInstance].enableFreehandPencilKit = NO;
 
+        self.propertiesBtn.enabled = NO;
         if (@available(iOS 11.0, *)) {
             self.topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(50, self.window.safeAreaInsets.top, self.pdfListView.frame.size.width-100, 50)];
             self.topToolBar.delegate = self;
@@ -433,6 +439,7 @@
             [self.pdfListView addSubview:self.topToolBar];
         }
     } else if (CPDFViewAnnotationModeSignature == self.selectedIndex) {
+        self.propertiesBtn.enabled = NO;
         CAnnotStyle *annotStytle = self.annotManage.annotStyle;
         AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
         self.signatureVC = [[CPDFSignatureViewController alloc] initWithStyle:annotStytle];
@@ -441,6 +448,7 @@
         self.signatureVC.transitioningDelegate = presentationController;
         [self.parentVC presentViewController:self.signatureVC animated:YES completion:nil];
     } else if (CPDFViewAnnotationModeStamp == self.selectedIndex) {
+        self.propertiesBtn.enabled = NO;
         AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
         CPDFStampViewController *stampVC = [[CPDFStampViewController alloc] init];
         presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:self.signatureVC presentingViewController:self.parentVC];
@@ -448,6 +456,7 @@
         stampVC.transitioningDelegate = presentationController;
         [self.parentVC presentViewController:stampVC animated:YES completion:nil];
     } else if (CPDFViewAnnotationModeImage == self.selectedIndex) {
+        self.propertiesBtn.enabled = NO;
         [self createImageAnnotaion];
     } else if (CPDFViewAnnotationModeLink == self.selectedIndex) {
         self.propertiesBtn.enabled = NO;
@@ -538,30 +547,35 @@
 
 #pragma mark - CPDFSignatureViewControllerDelegate
 
+- (void)signatureViewControllerDismiss:(CPDFSignatureViewController *)signatureViewController {
+    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+}
+
 - (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController {
     CPDFSignatureEditViewController *editVC = [[CPDFSignatureEditViewController alloc] init];
+    CNavigationController *nav = [[CNavigationController alloc]initWithRootViewController:editVC];
     editVC.delegate = self;
-    [self.parentVC.navigationController pushViewController:editVC animated:NO];
+    
+    [self.parentVC presentViewController:nav animated:YES completion:nil];
 }
 
 - (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController image:(UIImage *)image {
     CPDFSignatureAnnotation *annotation = [[CPDFSignatureAnnotation alloc] initWithDocument:self.annotManage.pdfListView.document];
     [annotation setImage:image];
-    [self.annotManage.pdfListView addAnnotation:annotation];
-    
-    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
-    self.annotManage.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
-    [self reloadData];
+
+    self.annotManage.pdfListView.addAnnotation = annotation;
 }
 
 #pragma mark - CPDFSignatureEditViewControllerDelegate
 
 - (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController image:(UIImage *)image{
     [[CSignatureManager sharedManager] addImageSignature:image];
-    self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
-    self.annotManage.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
     [self reloadData];
     [self.signatureVC.tableView reloadData];
+    
+    CPDFSignatureAnnotation *annotation = [[CPDFSignatureAnnotation alloc] initWithDocument:self.annotManage.pdfListView.document];
+    [annotation setImage:image];
+    self.annotManage.pdfListView.addAnnotation = annotation;
 }
 
 #pragma mark - CPDFNoteViewControllerDelegate

+ 0 - 30
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListMagnifierView/CPDFListMagnifierView.h

@@ -1,30 +0,0 @@
-//
-//  CPDFListMagnifierView.h
-//  compdfkit-tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <UIKit/UIKit.h>
-
-typedef NS_ENUM(NSInteger, CPDFListMagnifierViewStyle) {
-    CPDFListMagnifierViewStyleRect = 0,
-    CPDFListMagnifierViewStyleCircle
-};
-
-@interface CPDFListMagnifierView : UIView
-
-@property (nonatomic,assign) CGFloat scale;
-
-@property (nonatomic,assign) UIView *viewToMagnify;
-
-@property (nonatomic,assign) CGPoint pointToMagnify;
-
-@property (nonatomic,assign) CPDFListMagnifierViewStyle style;
-
-@end

+ 0 - 86
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListMagnifierView/CPDFListMagnifierView.m

@@ -1,86 +0,0 @@
-//
-//  CPDFListMagnifierView.m
-//  compdfkit-tools
-//
-//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import "CPDFListMagnifierView.h"
-
-@implementation CPDFListMagnifierView
-
-#pragma mark - Initializers
-
-- (instancetype)init {
-    if (self = [super initWithFrame:CGRectMake(0, 0, 145, 59)]) {
-        self.backgroundColor = [UIColor clearColor];
-        self.scale = 1.0;
-    }
-    return self;
-}
-
-#pragma mark - Accessors
-
-- (void)setStyle:(CPDFListMagnifierViewStyle)style {
-    _style = style;
-    
-    if (CPDFListMagnifierViewStyleRect == style) {
-        self.frame = CGRectMake(0, 0, 145, 59);
-    } else if (CPDFListMagnifierViewStyleCircle == style) {
-        self.frame = CGRectMake(0, 0, 127, 127);
-    }
-}
-
-#pragma mark - Draw
-
-- (void)drawRect:(CGRect)rect {
-    if (CPDFListMagnifierViewStyleRect == self.style) {
-        CGContextRef context = UIGraphicsGetCurrentContext();
-        UIImage *image = [UIImage imageNamed:@"magnifier-ranged-lo.png" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-        [image drawInRect:self.bounds];
-        
-        UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0);
-        CGContextRef mirrorContext = UIGraphicsGetCurrentContext();
-        CGContextTranslateCTM(mirrorContext, self.bounds.size.width/2.0, self.bounds.size.height/2.0-2);
-        CGContextScaleCTM(mirrorContext, self.scale, -self.scale);
-        CGContextTranslateCTM(mirrorContext, -self.pointToMagnify.x, -self.pointToMagnify.y);
-        [self.viewToMagnify.layer renderInContext:mirrorContext];
-        
-        UIImage *maskImage =  [UIImage imageNamed:@"CPDFListViewImageNameMagnifierRangedMask" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-        CGImageRef imageRef = CGBitmapContextCreateImage(mirrorContext);
-        CGImageRef maskImageRef = CGImageCreateWithMask(imageRef, maskImage.CGImage);
-        CGImageRelease(imageRef);
-        UIGraphicsEndImageContext();
-        CGContextDrawImage(context, self.bounds, maskImageRef);
-        CGImageRelease(maskImageRef);
-        
-        image = [UIImage imageNamed:@"CPDFListViewImageNameMagnifierRangedHi" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-        [image drawInRect:self.bounds];
-    } else if (CPDFListMagnifierViewStyleCircle == self.style) {
-        CGContextRef context = UIGraphicsGetCurrentContext();
-        UIImage *image = [UIImage imageNamed:@"CPDFListViewImageNameMagnifierLoupeLo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-        [image drawInRect:self.bounds];
-        
-        UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0);
-        CGContextRef mirrorContext = UIGraphicsGetCurrentContext();
-        CGContextTranslateCTM(mirrorContext, self.bounds.size.width/2.0, self.bounds.size.height/2.0);
-        CGContextScaleCTM(mirrorContext, self.scale, -self.scale);
-        CGContextTranslateCTM(mirrorContext, -self.pointToMagnify.x, -self.pointToMagnify.y);
-        [self.viewToMagnify.layer renderInContext:mirrorContext];
-        
-        UIImage *maskImage =  [UIImage imageNamed:@"CPDFListViewImageNameMagnifierLoupeHi" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-        CGImageRef imageRef = CGBitmapContextCreateImage(mirrorContext);
-        CGImageRef maskImageRef = CGImageCreateWithMask(imageRef, maskImage.CGImage);
-        CGImageRelease(imageRef);
-        UIGraphicsEndImageContext();
-        CGContextDrawImage(context, self.bounds, maskImageRef);
-        CGImageRelease(maskImageRef);
-    }
-}
-
-@end

+ 3 - 49
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Annotation.m

@@ -13,7 +13,6 @@
 #import "CPDFListView+Annotation.h"
 
 #import "CPDFListView+Private.h"
-#import "CPDFListMagnifierView.h"
 #import "CAnnotStyle.h"
 
 #import <MobileCoreServices/UTCoreTypes.h>
@@ -352,31 +351,6 @@
     }
 }
 
-#pragma mark - Magnifier
-
-- (void)addMagnifierAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
-    if (!self.magnifierView) {
-        self.magnifierView = [[CPDFListMagnifierView alloc] init];
-        self.magnifierView.style = CPDFListMagnifierViewStyleCircle;
-    }
-    point = [self convertPoint:point fromPage:page];
-    CGPoint center = [self convertPoint:point toView:self.superview];
-    self.magnifierView.scale = 1.0;
-    self.magnifierView.pointToMagnify = point;
-    self.magnifierView.viewToMagnify = self;
-    self.magnifierView.center = CGPointMake(center.x, center.y - self.magnifierView.frame.size.height/2.0 - 20);
-    if ([self.magnifierView superview]) {
-        [self.magnifierView setNeedsDisplay];
-    } else {
-        [self.superview addSubview:self.magnifierView];
-    }
-}
-
-- (void)removeMagnifier {
-    [self.magnifierView removeFromSuperview];
-    self.magnifierView = nil;
-}
-
 #pragma mark - Menu
 
 - (NSArray<UIMenuItem *> *)annotationMenuItemsAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
@@ -446,13 +420,6 @@
             self.draggingType = CPDFAnnotationDraggingCenter;
         }
         self.draggingPoint = point;
-        
-        if (CPDFAnnotationDraggingCenter == self.draggingType) {
-            if ([self.activeAnnotation isKindOfClass:[CPDFFreeTextAnnotation class]] ||
-                [self.activeAnnotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
-                [self addMagnifierAtPoint:point forPage:page];
-            }
-        }
     }
 }
 
@@ -467,12 +434,6 @@
         [self setNeedsDisplayForPage:page];
         self.draggingPoint = point;
         
-        if (CPDFAnnotationDraggingCenter == self.draggingType) {
-            if ([self.activeAnnotation isKindOfClass:[CPDFFreeTextAnnotation class]] ||
-                [self.activeAnnotation isKindOfClass:[CPDFSignatureAnnotation class]]) {
-                [self addMagnifierAtPoint:point forPage:page];
-            }
-        }
     } else if (CPDFViewAnnotationModeLink == self.annotationMode) {
         CGRect rect = CGRectZero;
         if (point.x > self.addLinkPoint.x) {
@@ -603,16 +564,12 @@
                 if (!isAudioRecord) {
                     [self addAnnotationMediaAtPoint:point forPage:page];
                 }
-            } else if (CPDFViewAnnotationModeStamp == self.annotationMode) {
+            } else if (CPDFViewAnnotationModeStamp == self.annotationMode || CPDFViewAnnotationModeSignature == self.annotationMode) {
+                self.annotationMode = CPDFViewAnnotationModeNone;
                 [self addAnnotationAtPoint:point forPage:page];
-                if ([self.performDelegate respondsToSelector:@selector(PDFListViewPerformTouchEnded:)]) {
-                    [self.performDelegate PDFListViewPerformTouchEnded:self];
-                }
             } else if (CPDFViewAnnotationModeImage == self.annotationMode) {
+                self.annotationMode = CPDFViewAnnotationModeNone;
                 [self addAnnotationAtPoint:point forPage:page];
-                if ([self.performDelegate respondsToSelector:@selector(PDFListViewPerformTouchEnded:)]) {
-                    [self.performDelegate PDFListViewPerformTouchEnded:self];
-                }
             } else {
                 [self addAnnotation:self.annotationMode atPoint:point forPage:page];
             }
@@ -636,12 +593,10 @@
         
         [self showMenuForAnnotation:self.activeAnnotation];
     }
-    [self removeMagnifier];
 }
 
 - (void)annotationTouchCancelledAtPoint:(CGPoint)point forPage:(CPDFPage *)page {
     self.draggingType = CPDFAnnotationDraggingNone;
-    [self removeMagnifier];
     
     if(self.undoMove) {
         [[self undoPDFManager] endUndoGrouping];
@@ -1211,7 +1166,6 @@
     [self updateScrollEnabled];
     
     [self showMenuForAnnotation:annotation];
-    [self updateActiveAnnotations:@[]];
 }
 
 - (void)addAnnotationMediaAtPoint:(CGPoint)point forPage:(CPDFPage *)page {

+ 0 - 4
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Private.h

@@ -12,8 +12,6 @@
 
 #import "CPDFListView.h"
 
-#import "CPDFListMagnifierView.h"
-
 typedef NS_ENUM(NSInteger, CPDFAnnotationDraggingType) {
     CPDFAnnotationDraggingNone = 0,
     CPDFAnnotationDraggingCenter,
@@ -57,8 +55,6 @@ typedef NS_ENUM(NSInteger, CPDFAnnotationDraggingType) {
 
 @property (nonatomic, readonly) CPDFAnnotation *activeAnnotation;
 
-@property (nonatomic, strong) CPDFListMagnifierView *magnifierView;
-
 @property (nonatomic, strong) NSMutableArray *notes;
 
 @property (nonatomic, strong) NSMapTable *undoGroupOldPropertiesPerNote;