Browse Source

Merge branch 'compdfkit_demo_ios' of http://git.kdan.cc:8865/Others/kmpdfkit_demo into compdfkit_demo_ios

Conflicts:
	PDFViewer/PDFViewer.xcodeproj/project.pbxproj
dinglingui 1 year ago
parent
commit
8cd15e4db1

+ 3 - 3
ComPDFKit_Tools/ComPDFKit_Tools/Annotations/PDFAnnotationBar/CPDFAnnotationToolBar.m

@@ -119,7 +119,7 @@
             for (NSInteger i = 0; i< self.annotationBtns.count; i++) {
                 CPDFAnnotationBarButton *button = [self.annotationBtns objectAtIndex:i];
                 if(button.tag == self.selectedIndex) {
-                    button.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+                    button.backgroundColor = [UIColor clearColor];
                     self.selectedIndex = 0;
                     break;
                 }
@@ -132,7 +132,7 @@
                 button.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
                 self.selectedIndex = button.tag;
             } else {
-                button.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+                button.backgroundColor = [UIColor clearColor];
             }
         }
     }
@@ -348,7 +348,7 @@
         }
         self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
         self.selectedIndex = 0;
-        button.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+        button.backgroundColor = [UIColor clearColor];
         isSelect = NO;
     }
     

+ 6 - 2
ComPDFKit_Tools/ComPDFKit_Tools/Common/Controls/BOTA/CPDFBOTAViewController.m

@@ -214,8 +214,12 @@
 
 - (void)annotationViewController:(CPDFAnnotationViewController *)annotationViewController jumptoPage:(NSInteger)pageIndex selectAnnot:(CPDFAnnotation *)annot {
     [self.pdfView goToPageIndex:pageIndex animated:NO];
-    CGSize visibleRect = self.pdfView.documentView.visibleSize;
-    [self.pdfView goToRect:CGRectMake(annot.bounds.origin.x, annot.bounds.origin.y+visibleRect.height/2, annot.bounds.size.width, annot.bounds.size.height) onPage:[self.pdfView.document pageAtIndex:pageIndex] animated:YES];
+    if (@available(iOS 12.0, *)) {
+        CGSize visibleRect = self.pdfView.documentView.visibleSize;
+        [self.pdfView goToRect:CGRectMake(annot.bounds.origin.x, annot.bounds.origin.y+visibleRect.height/2, annot.bounds.size.width, annot.bounds.size.height) onPage:[self.pdfView.document pageAtIndex:pageIndex] animated:YES];
+    } else {
+        [self.pdfView goToRect:CGRectMake(annot.bounds.origin.x, annot.bounds.origin.y+100, annot.bounds.size.width, annot.bounds.size.height) onPage:[self.pdfView.document pageAtIndex:pageIndex] animated:YES];
+    }
 
     if([self.delegate respondsToSelector:@selector(botaViewControllerDismiss:)]) {
         [self.delegate botaViewControllerDismiss:self];

+ 3 - 2
ComPDFKit_Tools/ComPDFKit_Tools/Common/Views/PDFProperties/CPDFThicknessSliderView.m

@@ -36,7 +36,7 @@
         self.thicknessSlider = [[UISlider alloc] init];
         self.thicknessSlider.autoresizingMask = UIViewAutoresizingFlexibleWidth;
         self.thicknessSlider.maximumValue = 10.0;
-        self.thicknessSlider.minimumValue = 1.0;
+        self.thicknessSlider.minimumValue = 0.1;
         [self.thicknessSlider addTarget:self action:@selector(buttonItemClicked_changes:) forControlEvents:UIControlEventValueChanged];
         [self addSubview:self.thicknessSlider];
         
@@ -65,7 +65,7 @@
 - (void)setDefaultValue:(CGFloat)defaultValue {
     _defaultValue = defaultValue;
     self.thicknessSlider.value = (float) (defaultValue * 10);
-    self.startLabel.text = [NSString stringWithFormat:@"%d pt", (int)defaultValue * 100];
+    self.startLabel.text = [NSString stringWithFormat:@"%d pt", (int)(defaultValue * 100)];
 }
 
 
@@ -80,6 +80,7 @@
 #pragma mark - Action
 
 - (void)buttonItemClicked_changes:(UISlider *)sender {
+    NSLog(@"senderValue %f",sender.value);
     self.sliderCount -- ;
     if(self.sliderCount == 3) {
         self.startLabel.text = [NSString stringWithFormat:@"%.0f pt", sender.value * self.thick];

+ 4 - 2
ComPDFKit_Tools/ComPDFKit_Tools/DocsEditor/PDFPageEdit/Control/CPDFPageEditViewController.m

@@ -561,8 +561,9 @@
     for (NSIndexPath *indexPath in [self.collectionView indexPathsForSelectedItems]) {
         [indexSet addIndex:indexPath.item];
     }
-    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
+    
     [self.pdfView.document removePageAtIndexSet:indexSet];
+    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
     [self.pageEditToolBar reloadData];
     
     [self updateTitle];
@@ -580,8 +581,9 @@
     for (NSIndexPath *indexPath in [self.collectionView indexPathsForSelectedItems]) {
         [deleteIndexSet addIndex:indexPath.item];
     }
-    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
+    
     [self.pdfView.document removePageAtIndexSet:deleteIndexSet];
+    [self.collectionView deleteItemsAtIndexPaths:[self.collectionView indexPathsForSelectedItems]];
     
     [self.pdfView.document importPages:indexSet fromDocument:document atIndex:min];
     [self.collectionView reloadData];

+ 10 - 0
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormCheckBoxViewController.m

@@ -134,6 +134,16 @@
         self.colorSelectView.selectedColor = self.buttonWidget.fontColor;
     }
     
+    if(self.buttonWidget.borderColor == nil){
+        self.borderColorView.selectedColor = [UIColor blackColor];
+        self.buttonWidget.borderColor = self.borderColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        self.borderColorView.selectedColor = self.buttonWidget.borderColor;
+    }
+    
+    self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
+    
     
     switch (buttonWidget.widgetCheckStyle) {
         case CPDFWidgetButtonStyleCheck:{

+ 2 - 0
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormRadioButtonViewController.m

@@ -121,6 +121,8 @@
         self.borderColorView.selectedColor = self.buttonWidget.borderColor;
     }
     
+    self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
+    
     
     if(self.buttonWidget.fontColor == nil) {
         self.colorSelectView.selectedColor = [UIColor blackColor];

+ 1 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormTextViewController.m

@@ -146,10 +146,7 @@
     //border color
     self.borderColorView.selectedColor = self.textWidget.borderColor;
     //back groundColor
-    CGFloat red, green, blue, alpha;
-    [self.textWidget.backgroundColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.backGroundColorView.selectedColor = [UIColor colorWithRed:red green:green blue:blue alpha:self.textWidget.backgroundOpacity];
-    
+    self.backGroundColorView.selectedColor = self.textWidget.backgroundColor;
     //Text color
     self.textColorView.selectedColor = self.textWidget.fontColor;
     

+ 0 - 4
ContentEditor/ContentEditor/CPDFViewController.m

@@ -291,10 +291,6 @@
         
         [self presentViewController:self.baseVC animated:YES completion:nil];
     }
-    
-    if (self.menuPoint.y < self.pdfListView.documentView.visibleSize.height/2) {
-        [self.pdfListView goToRect:CGRectMake(self.menuPoint.x, self.pdfListView.documentView.visibleSize.height/2-50, 1, 1) onPage:[self.pdfListView.document pageAtIndex:self.pdfListView.currentPageIndex] animated:YES];
-    }
 }
 
 #pragma mark - CPDFSignatureViewControllerDelegate