Skip to content

Commit

Permalink
Fixed rotation not working for other editor types
Browse files Browse the repository at this point in the history
  • Loading branch information
pilipovicmilan04 authored Jun 18, 2024
1 parent 497db08 commit a7638d8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/display/editor/annotation_editor_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,20 +506,15 @@ class AnnotationEditorLayer {
return;
}
const rotationOfThisPage = this.viewport.rotation;
const inkEditor = this.div.querySelector(".inkEditor.editing");
if (!inkEditor) {
return;
}
const currentInkRotation = Number(
inkEditor.getAttribute("data-editor-rotation")
);
const currentRotation =
360 - Number(this.div.getAttribute("data-main-rotation"));

const pageRotation =
(360 + rotationOfThisPage - editor._uiManager.viewParameters.rotation) %
360;
editor.pageRotation = pageRotation;
editor.rotation = rotationOfThisPage;
editor.div.setAttribute("data-editor-rotation", currentInkRotation);
editor.div.setAttribute("data-editor-rotation", currentRotation);
}

/**
Expand Down

0 comments on commit a7638d8

Please sign in to comment.