Skip to content

Commit

Permalink
Fix stamps not being correctly detected (#384)
Browse files Browse the repository at this point in the history
* Fix stamps not being correctly detected

* Fix stamps and polylines not being correctly detected on iOS

Co-authored-by: RadAzzouz <[email protected]>
  • Loading branch information
Reinhard Hafenscher and RadAzzouz authored Jan 11, 2021
1 parent 0355c8e commit 4b4bada
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public static EnumSet<AnnotationType> getAnnotationTypeFromString(@Nullable fina
if ("pspdfkit/text".equalsIgnoreCase(type)) {
return EnumSet.of(AnnotationType.FREETEXT);
}
if ("pspdfkit/stamp".equalsIgnoreCase(type)) {
return EnumSet.of(AnnotationType.STAMP);
}
return EnumSet.noneOf(AnnotationType.class);
}
}
4 changes: 4 additions & 0 deletions ios/RCTPSPDFKit/Converters/RCTConvert+PSPDFAnnotation.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ + (PSPDFAnnotationType)annotationTypeFromInstantJSONType:(NSString *)type {
return PSPDFAnnotationTypeLine;
} else if ([type isEqualToString:@"pspdfkit/shape/polygon"]) {
return PSPDFAnnotationTypePolygon;
} else if ([type isEqualToString:@"pspdfkit/shape/polyline"]) {
return PSPDFAnnotationTypePolyLine;
} else if ([type isEqualToString:@"pspdfkit/shape/rectangle"]) {
return PSPDFAnnotationTypeSquare;
} else if ([type isEqualToString:@"pspdfkit/text"]) {
return PSPDFAnnotationTypeFreeText;
} else if ([type isEqualToString:@"pspdfkit/stamp"]) {
return PSPDFAnnotationTypeStamp;
} else {
return PSPDFAnnotationTypeUndefined;
}
Expand Down

0 comments on commit 4b4bada

Please sign in to comment.