Skip to content

Commit

Permalink
add upstream mozilla/pdf.js#6239
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeleznick committed Mar 10, 2023
1 parent 0c8bb2b commit 34ef2e3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions base/shared/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ var Annotation = (function AnnotationClosure() {
var data = this.data = {};

data.subtype = dict.get('Subtype').name;
var rect = dict.get('Rect');
data.rect = Util.normalizeRect(rect);
data.annotationFlags = dict.get('F');
this.setRectangle(dict.get('Rect'));
data.rect = this.rectangle;

var color = dict.get('C');
if (isArray(color) && color.length === 3) {
Expand All @@ -104,6 +104,20 @@ var Annotation = (function AnnotationClosure() {
}

Annotation.prototype = {
/**
* Set the rectangle.
*
* @public
* @memberof Annotation
* @param {Array} rectangle - The rectangle array with exactly four entries
*/
setRectangle: function Annotation_setRectangle(rectangle) {
if (isArray(rectangle) && rectangle.length === 4) {
this.rectangle = Util.normalizeRect(rectangle);
} else {
this.rectangle = [0, 0, 0, 0];
}
},

getData: function Annotation_getData() {
return this.data;
Expand Down

0 comments on commit 34ef2e3

Please sign in to comment.