diff options
| author | bobzel <zzzman@gmail.com> | 2021-03-04 12:56:05 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-03-04 12:56:05 -0500 |
| commit | 454f004e7249c78696fa7085fcf10c59ab8e327a (patch) | |
| tree | 8e84db67d85b6bf04567c77a06fcf556684d7824 /src/client/views/nodes | |
| parent | 744dd170f0a4d4e4f2f83d763960edfd8cdb1924 (diff) | |
more fitWidth fixes for PDF
Diffstat (limited to 'src/client/views/nodes')
| -rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 15 | ||||
| -rw-r--r-- | src/client/views/nodes/formattedText/EquationView.tsx | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 33147e7f3..c0e0296fe 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -6,7 +6,7 @@ import "pdfjs-dist/web/pdf_viewer.css"; import { Doc, Opt, WidthSym } from "../../../fields/Doc"; import { documentSchema } from '../../../fields/documentSchemas'; import { makeInterface } from "../../../fields/Schema"; -import { Cast, NumCast } from "../../../fields/Types"; +import { Cast, NumCast, StrCast } from '../../../fields/Types'; import { PdfField } from "../../../fields/URLField"; import { TraceMobx } from '../../../fields/util'; import { Utils, returnOne } from '../../../Utils'; @@ -23,6 +23,7 @@ import { pageSchema } from "./ImageBox"; import "./PDFBox.scss"; import React = require("react"); import { DocAfterFocusFunc } from './DocumentView'; +import { Docs } from '../../documents/Documents'; type PdfDocument = makeInterface<[typeof documentSchema, typeof panZoomSchema, typeof pageSchema]>; const PdfDocument = makeInterface(documentSchema, panZoomSchema, pageSchema); @@ -85,7 +86,17 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps, PdfDocum this.initialScrollTarget = doc; return this._pdfViewer?.scrollFocus(doc, smooth); } - getAnchor = () => this.rootDoc; + getAnchor = () => { + const anchor = Docs.Create.TextanchorDocument({ + title: StrCast(this.rootDoc.title + " " + this.layoutDoc._scrollTop), + useLinkSmallAnchor: true, + hideLinkButton: true, + annotationOn: this.rootDoc, + y: NumCast(this.layoutDoc._scrollTop), + }); + this.addDocument(anchor); + return anchor; + } componentWillUnmount() { this._selectReactionDisposer?.(); } componentDidMount() { this.props.setContentView?.(this); diff --git a/src/client/views/nodes/formattedText/EquationView.tsx b/src/client/views/nodes/formattedText/EquationView.tsx index eff018635..056e61846 100644 --- a/src/client/views/nodes/formattedText/EquationView.tsx +++ b/src/client/views/nodes/formattedText/EquationView.tsx @@ -62,6 +62,7 @@ export class EquationViewInternal extends React.Component<IEquationViewInternal> display: "inline-block", width: this.props.width, height: this.props.height, + bottom: 3, }}> <EquationEditor value={StrCast(this._textBoxDoc[this._fieldKey], "y=")} |
