[Pkg-javascript-commits] [pdf.js] 223/414: don't render highlight/underline/squiggly/strikeout annotations that doesn't have popup

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 6762ff2fd66c6d974d5efd2b7f33ced0b4aca752
Author: Xiliang Chen <xlchen1291 at gmail.com>
Date:   Mon Feb 22 13:10:20 2016 +1300

    don't render highlight/underline/squiggly/strikeout annotations that doesn't have popup
---
 src/core/annotation.js          |  4 ++++
 src/display/annotation_layer.js | 12 ++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/core/annotation.js b/src/core/annotation.js
index 46a59c9..540fdd6 100644
--- a/src/core/annotation.js
+++ b/src/core/annotation.js
@@ -797,6 +797,7 @@ var HighlightAnnotation = (function HighlightAnnotationClosure() {
     Annotation.call(this, parameters);
 
     this.data.annotationType = AnnotationType.HIGHLIGHT;
+    this.data.hasPopup = parameters.dict.has('Popup');
 
     // PDF viewers completely ignore any border styles.
     this.data.borderStyle.setWidth(0);
@@ -812,6 +813,7 @@ var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
     Annotation.call(this, parameters);
 
     this.data.annotationType = AnnotationType.UNDERLINE;
+    this.data.hasPopup = parameters.dict.has('Popup');
 
     // PDF viewers completely ignore any border styles.
     this.data.borderStyle.setWidth(0);
@@ -827,6 +829,7 @@ var SquigglyAnnotation = (function SquigglyAnnotationClosure() {
     Annotation.call(this, parameters);
 
     this.data.annotationType = AnnotationType.SQUIGGLY;
+    this.data.hasPopup = parameters.dict.has('Popup');
 
     // PDF viewers completely ignore any border styles.
     this.data.borderStyle.setWidth(0);
@@ -842,6 +845,7 @@ var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() {
     Annotation.call(this, parameters);
 
     this.data.annotationType = AnnotationType.STRIKEOUT;
+    this.data.hasPopup = parameters.dict.has('Popup');
 
     // PDF viewers completely ignore any border styles.
     this.data.borderStyle.setWidth(0);
diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js
index 722cf17..2869e52 100644
--- a/src/display/annotation_layer.js
+++ b/src/display/annotation_layer.js
@@ -617,7 +617,8 @@ var PopupElement = (function PopupElementClosure() {
 var HighlightAnnotationElement = (
     function HighlightAnnotationElementClosure() {
   function HighlightAnnotationElement(parameters) {
-    AnnotationElement.call(this, parameters, true);
+    var isRenderable = parameters.data.hasPopup;
+    AnnotationElement.call(this, parameters, isRenderable);
   }
 
   Util.inherit(HighlightAnnotationElement, AnnotationElement, {
@@ -644,7 +645,8 @@ var HighlightAnnotationElement = (
 var UnderlineAnnotationElement = (
     function UnderlineAnnotationElementClosure() {
   function UnderlineAnnotationElement(parameters) {
-    AnnotationElement.call(this, parameters, true);
+    var isRenderable = parameters.data.hasPopup;
+    AnnotationElement.call(this, parameters, isRenderable);
   }
 
   Util.inherit(UnderlineAnnotationElement, AnnotationElement, {
@@ -670,7 +672,8 @@ var UnderlineAnnotationElement = (
  */
 var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() {
   function SquigglyAnnotationElement(parameters) {
-    AnnotationElement.call(this, parameters, true);
+    var isRenderable = parameters.data.hasPopup;
+    AnnotationElement.call(this, parameters, isRenderable);
   }
 
   Util.inherit(SquigglyAnnotationElement, AnnotationElement, {
@@ -697,7 +700,8 @@ var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() {
 var StrikeOutAnnotationElement = (
     function StrikeOutAnnotationElementClosure() {
   function StrikeOutAnnotationElement(parameters) {
-    AnnotationElement.call(this, parameters, true);
+    var isRenderable = parameters.data.hasPopup;
+    AnnotationElement.call(this, parameters, isRenderable);
   }
 
   Util.inherit(StrikeOutAnnotationElement, AnnotationElement, {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list