Merge pull request #14108 from Snuffleupagus/issue-14107

For Annotations that define a closed area, make all of it toggle the PopupAnnotation (issue 14107)
This commit is contained in:
Tim van der Meij 2021-10-10 15:29:54 +02:00 committed by GitHub
commit 3945965605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1798,6 +1798,7 @@ class LineAnnotationElement extends AnnotationElement {
// won't be possible to open/close the popup (note e.g. issue 11122).
line.setAttribute("stroke-width", data.borderStyle.width || 1);
line.setAttribute("stroke", "transparent");
line.setAttribute("fill", "transparent");
svg.appendChild(line);
this.container.append(svg);
@ -1844,7 +1845,7 @@ class SquareAnnotationElement extends AnnotationElement {
// won't be possible to open/close the popup (note e.g. issue 11122).
square.setAttribute("stroke-width", borderWidth || 1);
square.setAttribute("stroke", "transparent");
square.setAttribute("fill", "none");
square.setAttribute("fill", "transparent");
svg.appendChild(square);
this.container.append(svg);
@ -1891,7 +1892,7 @@ class CircleAnnotationElement extends AnnotationElement {
// won't be possible to open/close the popup (note e.g. issue 11122).
circle.setAttribute("stroke-width", borderWidth || 1);
circle.setAttribute("stroke", "transparent");
circle.setAttribute("fill", "none");
circle.setAttribute("fill", "transparent");
svg.appendChild(circle);
this.container.append(svg);
@ -1946,7 +1947,7 @@ class PolylineAnnotationElement extends AnnotationElement {
// won't be possible to open/close the popup (note e.g. issue 11122).
polyline.setAttribute("stroke-width", data.borderStyle.width || 1);
polyline.setAttribute("stroke", "transparent");
polyline.setAttribute("fill", "none");
polyline.setAttribute("fill", "transparent");
svg.appendChild(polyline);
this.container.append(svg);
@ -2034,7 +2035,7 @@ class InkAnnotationElement extends AnnotationElement {
// won't be possible to open/close the popup (note e.g. issue 11122).
polyline.setAttribute("stroke-width", data.borderStyle.width || 1);
polyline.setAttribute("stroke", "transparent");
polyline.setAttribute("fill", "none");
polyline.setAttribute("fill", "transparent");
// Create the popup ourselves so that we can bind it to the polyline
// instead of to the entire container (which is the default).