From fb8dc280679981fcaa9a03220f866b446c854399 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 13 Dec 2020 22:37:03 -0500 Subject: fixed comparisonBox's --- src/client/views/nodes/ComparisonBox.tsx | 11 ++++++----- src/client/views/nodes/ContentFittingDocumentView.tsx | 10 +++------- src/client/views/nodes/DocumentView.tsx | 3 --- 3 files changed, 9 insertions(+), 15 deletions(-) (limited to 'src') 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 { const whichDoc = Cast(this.dataDoc[`compareBox-${which}`], Doc, null); return whichDoc ? <> - + parentActive={this.props.active} /> {clearButton(which)} : // placeholder image if doc is missing
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 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 (
{!this.props.Document || !this.props.PanelWidth() ? (null) : (
(Docu @computed get contents() { TraceMobx(); - if (this.props.Document.type === DocumentType.PDF) { - console.log("Scaling = " + this.contentScaling()); - } return (