aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-10-26 20:58:42 -0400
committerbobzel <zzzman@gmail.com>2021-10-26 20:58:42 -0400
commit2330035b84c2d3475e0e1e7644a68008c048e0b4 (patch)
tree01cbe1c2f341e552861f0e7758575782481ad5fe /src/client/views/nodes/DocumentView.tsx
parent92f34533d58291036ff6123c38502cbd4e22300d (diff)
parentb30b1cb301ed742a128d5e17eea9c954d1fe0c22 (diff)
Merge branch 'master' into ink_v1
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx5
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() {