Skip to content

Commit a7638d8

Browse files
Fixed rotation not working for other editor types
1 parent 497db08 commit a7638d8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/display/editor/annotation_editor_layer.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -506,20 +506,15 @@ class AnnotationEditorLayer {
506506
return;
507507
}
508508
const rotationOfThisPage = this.viewport.rotation;
509-
const inkEditor = this.div.querySelector(".inkEditor.editing");
510-
if (!inkEditor) {
511-
return;
512-
}
513-
const currentInkRotation = Number(
514-
inkEditor.getAttribute("data-editor-rotation")
515-
);
509+
const currentRotation =
510+
360 - Number(this.div.getAttribute("data-main-rotation"));
516511

517512
const pageRotation =
518513
(360 + rotationOfThisPage - editor._uiManager.viewParameters.rotation) %
519514
360;
520515
editor.pageRotation = pageRotation;
521516
editor.rotation = rotationOfThisPage;
522-
editor.div.setAttribute("data-editor-rotation", currentInkRotation);
517+
editor.div.setAttribute("data-editor-rotation", currentRotation);
523518
}
524519

525520
/**

0 commit comments

Comments
 (0)