From b30b1cb301ed742a128d5e17eea9c954d1fe0c22 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 26 Oct 2021 20:40:58 -0400
Subject:  fix to ink rotation to preserve rotation center between rotations.

---
 src/client/views/nodes/DocumentView.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/DocumentView.tsx')

diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 949e0e168..cbb77f369 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -97,6 +97,7 @@ export interface DocComponentView {
     annotationKey?: string;
     getTitle?: () => string;
     getScrollHeight?: () => number;
+    getCenter?: (xf: Transform) => { X: number, Y: number };
     search?: (str: string, bwd?: boolean, clear?: boolean) => boolean;
 }
 export interface DocumentViewSharedProps {
@@ -1179,9 +1180,9 @@ export class DocumentView extends React.Component<DocumentViewProps> {
         const [[left, top], [right, bottom]] = [xf.transformPoint(0, 0), xf.transformPoint(this.panelWidth, this.panelHeight)];
         if (this.docView.props.LayoutTemplateString?.includes(LinkAnchorBox.name)) {
             const docuBox = this.docView.ContentDiv.getElementsByClassName("linkAnchorBox-cont");
-            if (docuBox.length) return docuBox[0].getBoundingClientRect();
+            if (docuBox.length) return { ...docuBox[0].getBoundingClientRect(), center: undefined };
         }
-        return { left, top, right, bottom };
+        return { left, top, right, bottom, center: this.ComponentView?.getCenter?.(xf) };
     }
 
     public iconify() {
-- 
cgit v1.2.3-70-g09d2

