mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Merge pull request #8691 from timvandermeij/square-circle-annotations
Implement support for square and circle annotations
This commit is contained in:
commit
320779e6ed
9 changed files with 267 additions and 55 deletions
|
@ -81,6 +81,12 @@ class AnnotationFactory {
|
|||
case 'Line':
|
||||
return new LineAnnotation(parameters);
|
||||
|
||||
case 'Square':
|
||||
return new SquareAnnotation(parameters);
|
||||
|
||||
case 'Circle':
|
||||
return new CircleAnnotation(parameters);
|
||||
|
||||
case 'Highlight':
|
||||
return new HighlightAnnotation(parameters);
|
||||
|
||||
|
@ -886,6 +892,24 @@ class LineAnnotation extends Annotation {
|
|||
}
|
||||
}
|
||||
|
||||
class SquareAnnotation extends Annotation {
|
||||
constructor(parameters) {
|
||||
super(parameters);
|
||||
|
||||
this.data.annotationType = AnnotationType.SQUARE;
|
||||
this._preparePopup(parameters.dict);
|
||||
}
|
||||
}
|
||||
|
||||
class CircleAnnotation extends Annotation {
|
||||
constructor(parameters) {
|
||||
super(parameters);
|
||||
|
||||
this.data.annotationType = AnnotationType.CIRCLE;
|
||||
this._preparePopup(parameters.dict);
|
||||
}
|
||||
}
|
||||
|
||||
class HighlightAnnotation extends Annotation {
|
||||
constructor(parameters) {
|
||||
super(parameters);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue