diff options
author | bobzel <zzzman@gmail.com> | 2021-02-11 14:49:42 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-02-11 14:49:42 -0500 |
commit | 170b6bceb26e0837f7864cb4ff5266003d06f995 (patch) | |
tree | 813e009e5c4c4caf879919d4082339254d720a77 /src/client/views/nodes/DocumentView.tsx | |
parent | 96d730a155cc9e49ee83c8e985fbc5de87e7959f (diff) |
fixed pinning documents with a group to zoom to view properly.
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 3fc39d554..34e0a2bc8 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -43,7 +43,7 @@ import React = require("react"); import { LinkDocPreview } from "./LinkDocPreview"; export type DocAfterFocusFunc = (notFocused: boolean) => Promise<boolean>; -export type DocFocusFunc = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc) => void; +export type DocFocusFunc = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc, docTransform?: Transform) => void; export type StyleProviderFunc = (doc: Opt<Doc>, props: Opt<DocumentViewProps | FieldViewProps>, property: string) => any; export interface DocComponentView { getAnchor: () => Doc; @@ -375,11 +375,11 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps } } - focus = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc) => { + focus = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc, docTransform?: Transform) => { if (this._componentView?.scrollFocus) { return this._componentView?.scrollFocus?.(doc, !LinkDocPreview.LinkInfo, afterFocus); // bcz: smooth parameter should really be passed into focus() instead of inferred here } - return this.props.focus(doc, willZoom, scale, afterFocus); + return this.props.focus(doc, willZoom, scale, afterFocus, docTransform); } onClick = action((e: React.MouseEvent | React.PointerEvent) => { if (!e.nativeEvent.cancelBubble && !this.Document.ignoreClick && this.props.renderDepth >= 0 && |