diff options
author | bobzel <zzzman@gmail.com> | 2020-12-13 22:37:03 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-12-13 22:37:03 -0500 |
commit | fb8dc280679981fcaa9a03220f866b446c854399 (patch) | |
tree | e3bc2b87a81fa410bf60fc61f90bda1044f41257 /src | |
parent | 4749b1a3132f00c7f11a404e612d9c1ce848579f (diff) |
fixed comparisonBox's
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/ComparisonBox.tsx | 11 | ||||
-rw-r--r-- | src/client/views/nodes/ContentFittingDocumentView.tsx | 10 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 3 |
3 files changed, 9 insertions, 15 deletions
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx index 9511668d5..1bf448bff 100644 --- a/src/client/views/nodes/ComparisonBox.tsx +++ b/src/client/views/nodes/ComparisonBox.tsx @@ -1,7 +1,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { action, observable } from 'mobx'; import { observer } from "mobx-react"; -import { Doc } from '../../../fields/Doc'; +import { Doc, WidthSym, HeightSym } from '../../../fields/Doc'; import { documentSchema } from '../../../fields/documentSchemas'; import { createSchema, makeInterface } from '../../../fields/Schema'; import { NumCast, Cast, StrCast } from '../../../fields/Types'; @@ -12,7 +12,7 @@ import "./ComparisonBox.scss"; import React = require("react"); import { ContentFittingDocumentView } from './ContentFittingDocumentView'; import { undoBatch } from '../../util/UndoManager'; -import { setupMoveUpEvents, emptyFunction, returnOne } from '../../../Utils'; +import { setupMoveUpEvents, emptyFunction, returnOne, OmitKeys } from '../../../Utils'; import { SnappingManager } from '../../util/SnappingManager'; import { DocumentViewProps } from './DocumentView'; @@ -84,10 +84,11 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps, C const displayDoc = (which: string) => { const whichDoc = Cast(this.dataDoc[`compareBox-${which}`], Doc, null); return whichDoc ? <> - <ContentFittingDocumentView {...this.props} + <ContentFittingDocumentView {...OmitKeys(this.props, ["NativeWidth", "NativeHeight"]).omit} + Document={whichDoc} + DataDoc={undefined} pointerEvents={"none"} - parentActive={this.props.active} - Document={whichDoc} /> + parentActive={this.props.active} /> {clearButton(which)} </> : // placeholder image if doc is missing <div className="placeholder"> diff --git a/src/client/views/nodes/ContentFittingDocumentView.tsx b/src/client/views/nodes/ContentFittingDocumentView.tsx index a673725dd..396f3807f 100644 --- a/src/client/views/nodes/ContentFittingDocumentView.tsx +++ b/src/client/views/nodes/ContentFittingDocumentView.tsx @@ -2,13 +2,12 @@ import React = require("react"); import { action, computed, observable } from "mobx"; import { observer } from "mobx-react"; import { Doc } from "../../../fields/Doc"; +import { NumCast } from "../../../fields/Types"; import { TraceMobx } from "../../../fields/util"; -import { emptyFunction, OmitKeys, returnOne, returnVal } from "../../../Utils"; +import { emptyFunction, OmitKeys, returnVal } from "../../../Utils"; import { DocumentView, DocumentViewProps } from "../nodes/DocumentView"; import { StyleProp } from "../StyleProvider"; import "./ContentFittingDocumentView.scss"; -import { DocumentType } from "../../documents/DocumentTypes"; -import { NumCast } from "../../../fields/Types"; interface ContentFittingDocumentViewProps { dontCenter?: "x" | "y" | "xy"; } @@ -56,13 +55,10 @@ export class ContentFittingDocumentView extends React.Component<DocumentViewProp PanelWidth = () => this.panelWidth; PanelHeight = () => this.panelHeight; NativeScaling = () => this.nativeScaling; - screenToLocalTransform = () => this.props.ScreenToLocalTransform().scale(1 / this.nativeScaling); + screenToLocalTransform = () => this.props.ScreenToLocalTransform().translate(-this.centeringX, -this.centeringY).scale(1 / this.nativeScaling); render() { TraceMobx(); - if (this.props.Document.type === DocumentType.PDF) { - console.log("PanelHeight = " + this.panelHeight); - } return (<div className="contentFittingDocumentView"> {!this.props.Document || !this.props.PanelWidth() ? (null) : ( <div className="contentFittingDocumentView-previewDoc" ref={this.ContentRef} diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 147740ae3..d847eff00 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -906,9 +906,6 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu @computed get contents() { TraceMobx(); - if (this.props.Document.type === DocumentType.PDF) { - console.log("Scaling = " + this.contentScaling()); - } return (<div className="documentView-contentsView" style={{ pointerEvents: this.props.contentPointerEvents as any, |