|
@@ -2392,38 +2392,16 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
}
|
|
}
|
|
} else if (CAnnotationTypeFreeText == self.annotationType ||
|
|
} else if (CAnnotationTypeFreeText == self.annotationType ||
|
|
CAnnotationTypeSignText == self.annotationType) {
|
|
CAnnotationTypeSignText == self.annotationType) {
|
|
- //保存参数
|
|
|
|
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
|
|
|
- NSString *fontName = [KMEditPDFTextManager.manager fetchFontNameWithFontName: [defaults objectForKey:CFreeTextNoteFontNameKey]];
|
|
|
|
- NSString *fontStyle = [KMEditPDFTextManager.manager fetchFontStyleWithFontName: [defaults objectForKey:CFreeTextNoteFontNameKey]];
|
|
|
|
- CGFloat size = [[defaults objectForKey:CFreeTextNoteFontSizeKey] floatValue];
|
|
|
|
- CGFloat opacity = [[defaults objectForKey:CFreeTextNoteOpacityKey] floatValue] ?:1.0;
|
|
|
|
-// CGFloat size = [[defaults objectForKey:CFreeTextNoteFontSizeKey] floatValue];
|
|
|
|
-// defaults.safe_setColor(annotation.color, forKey: CFreeTextNoteColorKey)
|
|
|
|
-// defaults.safe_setColor((annotation as! CPDFFreeTextAnnotation).fontColor, forKey: CFreeTextNoteFontColorKey)
|
|
|
|
-// defaults.set((annotation as! CPDFFreeTextAnnotation).alignment.rawValue, forKey: CFreeTextNoteAlignmentKey)
|
|
|
|
-// defaults.set((annotation as! CPDFFreeTextAnnotation).fontName(), forKey: CFreeTextNoteFontNameKey)
|
|
|
|
-// defaults.set((annotation as! CPDFFreeTextAnnotation).fontSize(), forKey: CFreeTextNoteFontSizeKey)
|
|
|
|
-// defaults.set(annotation.lineWidth(), forKey: CFreeTextNoteLineWidthKey)
|
|
|
|
-// defaults.set(annotation.borderStyle().rawValue, forKey: CFreeTextNoteLineStyleKey)
|
|
|
|
-// defaults.set(annotation.dashPattern(), forKey: CFreeTextNoteDashPatternKey)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// KMEditPDFTextFontModel *model = [KMEditPDFTextManager.manager fetchUserDefaultDataWithTypeStringWithType:@"Commonly"];
|
|
|
|
-// NSString *fontName = [KMEditPDFTextManager.manager fetchFontNameWithFontName:model.fontName];
|
|
|
|
-// NSString *fontStyle = [KMEditPDFTextManager.manager fetchFontStyleWithFontName:model.fontName];
|
|
|
|
-// CGFloat size = model.fontSize;
|
|
|
|
-
|
|
|
|
CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:self.annotationType];
|
|
CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:self.annotationType];
|
|
- annotationModel.fontName = [NSString stringWithFormat:@"%@-%@",fontName,fontStyle];
|
|
|
|
- annotationModel.fontSize = size;
|
|
|
|
- annotationModel.opacity = opacity;
|
|
|
|
|
|
|
|
CGFloat defaultWidth = annotationModel.fontSize;
|
|
CGFloat defaultWidth = annotationModel.fontSize;
|
|
CGFloat defaultHeight = annotationModel.fontSize;
|
|
CGFloat defaultHeight = annotationModel.fontSize;
|
|
NSSize defaultSize = ([page rotation] % 180 == 0) ? NSMakeSize(defaultWidth, defaultHeight) : NSMakeSize(defaultHeight, defaultWidth);
|
|
NSSize defaultSize = ([page rotation] % 180 == 0) ? NSMakeSize(defaultWidth, defaultHeight) : NSMakeSize(defaultHeight, defaultWidth);
|
|
CGRect bounds = CPDFListViewRectFromRightAndSize(pagePoint, defaultSize);
|
|
CGRect bounds = CPDFListViewRectFromRightAndSize(pagePoint, defaultSize);
|
|
CGFloat fontSize = annotationModel.fontSize;
|
|
CGFloat fontSize = annotationModel.fontSize;
|
|
|
|
+ NSString *fontName = annotationModel.fontName;
|
|
|
|
+ CGFloat opacity = annotationModel.opacity;
|
|
|
|
+
|
|
bounds = CGRectMake(pagePoint.x, pagePoint.y - (fontSize+2), defaultSize.width, (fontSize+2));
|
|
bounds = CGRectMake(pagePoint.x, pagePoint.y - (fontSize+2), defaultSize.width, (fontSize+2));
|
|
|
|
|
|
bounds = CPDFListViewConstrainRect(bounds, page.bounds,[CPDFListViewConfig defaultManager].annotationBorderOffset.floatValue);
|
|
bounds = CPDFListViewConstrainRect(bounds, page.bounds,[CPDFListViewConfig defaultManager].annotationBorderOffset.floatValue);
|