mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Support rotating editor layer
- As in the annotation layer, use percent instead of pixels as unit; - handle the rotation of the editor layer in allowing editing when rotation angle is not zero; - the different editors are rotated counterclockwise in order to be usable when the main page is itself rotated; - add support for saving/printing rotated editors.
This commit is contained in:
parent
b5fea8ff14
commit
0c420f5135
13 changed files with 473 additions and 159 deletions
|
@ -294,7 +294,7 @@ class AnnotationElement {
|
|||
container.style.width = `${elementWidth}%`;
|
||||
container.style.height = `${elementHeight}%`;
|
||||
|
||||
container.setAttribute("data-annotation-rotation", (360 - angle) % 360);
|
||||
container.setAttribute("data-main-rotation", (360 - angle) % 360);
|
||||
}
|
||||
|
||||
get _commonActions() {
|
||||
|
@ -2552,7 +2552,7 @@ class AnnotationLayer {
|
|||
|
||||
style.width = flipOrientation ? heightStr : widthStr;
|
||||
style.height = flipOrientation ? widthStr : heightStr;
|
||||
div.setAttribute("data-annotation-rotation", rotation);
|
||||
div.setAttribute("data-main-rotation", rotation);
|
||||
}
|
||||
|
||||
static #setAnnotationCanvasMap(div, annotationCanvasMap) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue