diff options
author | bobzel <zzzman@gmail.com> | 2021-10-26 20:40:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-10-26 20:40:58 -0400 |
commit | b30b1cb301ed742a128d5e17eea9c954d1fe0c22 (patch) | |
tree | 78bd96ec757329e74a92c244f0241de90c02beb9 /src/client/views/nodes/DocumentView.tsx | |
parent | 48d5e650ddc8caa8252561bbc91961f2f4677d6e (diff) |
fix to ink rotation to preserve rotation center between rotations.
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
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() { |