From 7bcdce059eb95a4119181353a77975cc7d8fe392 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 19 Feb 2019 20:26:41 -0500 Subject: fixed transforms and shift dragging docs to make a frame --- src/client/views/collections/CollectionDockingView.tsx | 1 + src/client/views/nodes/DocumentView.tsx | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 6739416df..ceb638ab4 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -179,6 +179,7 @@ export class CollectionDockingView extends CollectionViewBase { this._dragParent!.appendChild(this._dragElement!); DragManager.Root().removeChild(this._dragDiv); this._dragDiv = null; + this.stateChanged(); } tab.closeElement.off('click') //unbind the current click handler .click(function () { diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index ac1996ac5..518add0fc 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -245,6 +245,10 @@ export class DocumentView extends React.Component { SelectionManager.SelectDoc(this, ctrlPressed) } + screenToLocalTransform = () => { + var parentScrToLocalXf = this.props && this.props.ScreenToLocalTransform ? this.props.ScreenToLocalTransform() : new Transform(0, 0, 1); + return parentScrToLocalXf.transform(new Transform(0, 0, this.props ? 1 / this.props.Scaling : 1)); + } render() { let lkeys = this.props.Document.GetT(KeyStore.LayoutKeys, ListField); if (!lkeys || lkeys === "") { @@ -278,6 +282,7 @@ export class DocumentView extends React.Component { bindings.BackgroundView = backgroundView; } + bindings.ScreenToLocalTransform = this.screenToLocalTransform; // adds 'Scaling' to the screen to local Xf var width = this.props.Document.GetNumber(KeyStore.NativeWidth, 0); var strwidth = width > 0 ? width.toString() + "px" : "100%"; var height = this.props.Document.GetNumber(KeyStore.NativeHeight, 0); -- cgit v1.2.3-70-g09d2