mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Implement support for polygon annotations
This commit is contained in:
parent
99b17a494d
commit
8ccad276b2
3 changed files with 32 additions and 3 deletions
|
@ -90,6 +90,9 @@ class AnnotationFactory {
|
|||
case 'PolyLine':
|
||||
return new PolylineAnnotation(parameters);
|
||||
|
||||
case 'Polygon':
|
||||
return new PolygonAnnotation(parameters);
|
||||
|
||||
case 'Highlight':
|
||||
return new HighlightAnnotation(parameters);
|
||||
|
||||
|
@ -940,6 +943,15 @@ class PolylineAnnotation extends Annotation {
|
|||
}
|
||||
}
|
||||
|
||||
class PolygonAnnotation extends PolylineAnnotation {
|
||||
constructor(parameters) {
|
||||
// Polygons are specific forms of polylines, so reuse their logic.
|
||||
super(parameters);
|
||||
|
||||
this.data.annotationType = AnnotationType.POLYGON;
|
||||
}
|
||||
}
|
||||
|
||||
class HighlightAnnotation extends Annotation {
|
||||
constructor(parameters) {
|
||||
super(parameters);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue