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

Prevent double-rendering borders for PushButton-annotations (PR 14083 follow-up) #14174

Merged
Merged
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
12 changes: 10 additions & 2 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class AnnotationElement {
}

class LinkAnnotationElement extends AnnotationElement {
constructor(parameters) {
constructor(parameters, options = null) {
const isRenderable = !!(
parameters.data.url ||
parameters.data.dest ||
Expand All @@ -433,7 +433,11 @@ class LinkAnnotationElement extends AnnotationElement {
parameters.data.actions["Mouse Up"] ||
parameters.data.actions["Mouse Down"]))
);
super(parameters, { isRenderable, createQuadrilaterals: true });
super(parameters, {
isRenderable,
ignoreBorder: !!options?.ignoreBorder,
createQuadrilaterals: true,
});
}

render() {
Expand Down Expand Up @@ -1298,6 +1302,10 @@ class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {
}

class PushButtonWidgetAnnotationElement extends LinkAnnotationElement {
constructor(parameters) {
super(parameters, { ignoreBorder: parameters.data.hasAppearance });
}

render() {
// The rendering and functionality of a push button widget annotation is
// equal to that of a link annotation, but may have more functionality, such
Expand Down