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

[Annotation] Don't rotate the popups (bug 1819047) #16109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ class Driver {
let viewport = page.getViewport({
scale: PixelsPerInch.PDF_TO_CSS_UNITS,
});
if (task.rotation) {
viewport = viewport.clone({ rotation: task.rotation });
}
// Restrict the test from creating a canvas that is too big.
const MAX_CANVAS_PIXEL_DIMENSION = 4096;
const largestDimension = Math.max(viewport.width, viewport.height);
Expand Down
27 changes: 27 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7378,5 +7378,32 @@
"md5": "1eec7137e471a3d68a20855a04293b5b",
"link": true,
"type": "other"
},
{
"id": "annotation-link-text-popup-rotated-90",
"file": "pdfs/annotation-link-text-popup.pdf",
"md5": "4bbf56e81d47232de5f305124ab0ba27",
"rounds": 1,
"type": "eq",
"annotations": true,
"rotation": 90
},
{
"id": "annotation-link-text-popup-rotated-180",
"file": "pdfs/annotation-link-text-popup.pdf",
"md5": "4bbf56e81d47232de5f305124ab0ba27",
"rounds": 1,
"type": "eq",
"annotations": true,
"rotation": 180
},
{
"id": "annotation-link-text-popup-rotated-270",
"file": "pdfs/annotation-link-text-popup.pdf",
"md5": "4bbf56e81d47232de5f305124ab0ba27",
"rounds": 1,
"type": "eq",
"annotations": true,
"rotation": 270
}
]
13 changes: 13 additions & 0 deletions web/annotation_layer_builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,19 @@
pointer-events: auto;
}

.annotationLayer[data-main-rotation="270"] .popup {
transform-origin: top left;
transform: rotate(90deg) translateY(-100%);
}
.annotationLayer[data-main-rotation="180"] .popup {
transform-origin: top left;
transform: rotate(180deg) translate(-100%, -100%);
}
.annotationLayer[data-main-rotation="90"] .popup {
transform-origin: top left;
transform: rotate(270deg) translateX(-100%);
}

.annotationLayer .popup > * {
font-size: calc(9px * var(--scale-factor));
}
Expand Down