aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionDockingView.tsx
diff options
context:
space:
mode:
authorMonika Hedman <monika_hedman@brown.edu>2019-02-13 15:35:02 -0500
committerMonika Hedman <monika_hedman@brown.edu>2019-02-13 15:35:02 -0500
commite6ac9cd0a870f857822929f0efe28f5aeb50711a (patch)
tree929374bb1f92ddd83f35200be1147f5b7185a65d /src/client/views/collections/CollectionDockingView.tsx
parenta0430a981cd5996f3b3be60ed12f37f4fed235ae (diff)
parentc93c3e1970c6ecc91b60f1782e82b1bfdc7fef30 (diff)
Merge branch 'transforms' of https://github.com/browngraphicslab/Dash-Web into hedmanLocal
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index d3e90d11c..c870a9cf0 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -16,6 +16,7 @@ import "./CollectionDockingView.scss";
import { CollectionViewBase, CollectionViewProps, COLLECTION_BORDER_WIDTH } from "./CollectionViewBase";
import React = require("react");
import { changeDependenciesStateTo0 } from "mobx/lib/internal";
+import { Utils } from "../../../Utils";
@observer
export class CollectionDockingView extends CollectionViewBase {
@@ -100,6 +101,7 @@ export class CollectionDockingView extends CollectionViewBase {
return (<DocumentView key={value[i].Id} Document={value[i]}
AddDocument={this.addDocument} RemoveDocument={this.removeDocument}
GetTransform={() => Transform.Identity}
+ isTopMost={true}
Scaling={1}
ContainingCollectionView={this} DocumentView={undefined} />);
}
@@ -307,12 +309,16 @@ class RenderClass {
this.render();
}
render() {
- var nativeWidth = this._document.GetNumber(KeyStore.NativeWidth, 0);
+ let nativeWidth = this._document.GetNumber(KeyStore.NativeWidth, 0);
let scaling = nativeWidth > 0 ? this._htmlElement!.clientWidth / nativeWidth : 1;
ReactDOM.render((
<DocumentView key={this._document.Id} Document={this._document}
AddDocument={this._collectionDockingView.addDocument} RemoveDocument={this._collectionDockingView.removeDocument}
- GetTransform={() => Transform.Identity}
+ GetTransform={() => {
+ let { scale, translateX, translateY } = Utils.GetScreenTransform(this._htmlElement);
+ return this._collectionDockingView.props.GetTransform().scale(scale).translate(-translateX, -translateY)
+ }}
+ isTopMost={true}
Scaling={scaling}
ContainingCollectionView={this._collectionDockingView} DocumentView={undefined} />
),