Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-minor] Don't render highlight/underline/squiggly/strikeout annotations that doesn't have popup #7012

Merged
merged 1 commit into from
Feb 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/core/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
12 changes: 8 additions & 4 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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, {
Expand All @@ -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, {
Expand All @@ -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, {
Expand Down