|
@@ -65,10 +65,9 @@ class CPDFAnnotationMarkupExtraIvars: NSObject {
|
|
|
KMContextSetStrokeColorWithColor(context, color)
|
|
|
KMContextSetLineWidth(context, lineWidth)
|
|
|
|
|
|
- var count = 4
|
|
|
+ let count = 4
|
|
|
var step = 0
|
|
|
for _ in 0 ..< points.count {
|
|
|
-// for (NSUInteger i=0; i+count <= points.count;) {
|
|
|
if step + count > points.count {
|
|
|
break
|
|
|
}
|
|
@@ -120,7 +119,6 @@ class CPDFAnnotationMarkupExtraIvars: NSObject {
|
|
|
var i = lines.count
|
|
|
var isContained = false
|
|
|
|
|
|
-
|
|
|
while i > 0 && isContained == false {
|
|
|
i -= 1
|
|
|
isContained = NSPointInRect(point, lines.rect(at: UInt(i)))
|
|
@@ -201,8 +199,11 @@ class CPDFAnnotationMarkupExtraIvars: NSObject {
|
|
|
}
|
|
|
|
|
|
func markupContent() -> String {
|
|
|
- var contextString: String?
|
|
|
- if self.markupText().count < 1 {
|
|
|
+ var contextString: String? = self.markupText()
|
|
|
+ if contextString == nil || contextString?.isEmpty == true {
|
|
|
+ contextString = self.contents
|
|
|
+ }
|
|
|
+ if let cnt = contextString?.count, cnt < 1 {
|
|
|
let page = self.page
|
|
|
var exproString = ""
|
|
|
guard let points = self.quadrilateralPoints else {
|
|
@@ -255,7 +256,7 @@ class CPDFAnnotationMarkupExtraIvars: NSObject {
|
|
|
}
|
|
|
contextString = exproString
|
|
|
} else {
|
|
|
- contextString = self.markupText()
|
|
|
+// contextString = self.markupText()
|
|
|
}
|
|
|
return contextString ?? ""
|
|
|
}
|
|
@@ -297,13 +298,6 @@ class CPDFAnnotationMarkupExtraIvars: NSObject {
|
|
|
|
|
|
@objc extension CPDFMarkupAnnotation {
|
|
|
/*
|
|
|
- NSString *SKPDFAnnotationSelectionSpecifierKey = @"selectionSpecifier";
|
|
|
- @interface SKPDFAnnotationMarkupExtraIvars : NSObject {
|
|
|
- SKNoteText *noteText;
|
|
|
- }
|
|
|
- @property (nonatomic, retain) SKNoteText *noteText;
|
|
|
- @end
|
|
|
-
|
|
|
@implementation PDFAnnotationMarkup (SKExtensions)
|
|
|
|
|
|
static void addQuadPointsWithBounds(NSMutableArray *quadPoints, const NSRect bounds, const NSPoint origin, NSInteger rotation)
|