aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/DocumentManager.tsx24
-rw-r--r--src/client/views/Main.tsx1
-rw-r--r--src/client/views/TempTreeView.scss1
-rw-r--r--src/client/views/TempTreeView.tsx5
4 files changed, 20 insertions, 11 deletions
diff --git a/src/client/views/DocumentManager.tsx b/src/client/views/DocumentManager.tsx
index 35064d830..2bf942383 100644
--- a/src/client/views/DocumentManager.tsx
+++ b/src/client/views/DocumentManager.tsx
@@ -77,6 +77,8 @@ export class DocumentManager {
//console.log(doc.Title)
//gets document view that is in freeform collection
+ console.log("centering...")
+
let docView: DocumentView | null;
if (doc instanceof Document) {
@@ -99,9 +101,13 @@ export class DocumentManager {
scale = docView.props.ScreenToLocalTransform().Scale
let doc = docView.props.Document;
-
- XView = (-doc.GetNumber(KeyStore.X, 0) * scale) + (window.innerWidth / 2) - (width * scale / 2)
- YView = (-doc.GetNumber(KeyStore.Y, 0) * scale) + (window.innerHeight / 2) - (height * scale / 2)
+ console.log("hello")
+ XView = (-doc.GetNumber(KeyStore.X, 0) * scale) - (width * scale / 2)
+ YView = (-doc.GetNumber(KeyStore.Y, 0) * scale) - (height * scale / 2)
+ console.log("width: " + width)
+ console.log("height: " + height)
+ // XView = (-doc.GetNumber(KeyStore.X, 0) * scale) + (window.innerWidth / 2) - (width * scale / 2)
+ // YView = (-doc.GetNumber(KeyStore.Y, 0) * scale) + (window.innerHeight / 2) - (height * scale / 2)
//set x and y view of parent
if (docView instanceof CollectionView) {
DocumentManager.Instance.setViewportXY(docView, XView, YView)
@@ -111,16 +117,20 @@ export class DocumentManager {
else {
if (true) {
//view of parent
- let { width: parentWidth, height: parentHeight } = docView.props.ContainingCollectionView.props.documentSize();
+ //let { width: parentWidth, height: parentHeight } = docView.props.ContainingCollectionView.props.documentSize();
let scale = docView.props.ContainingCollectionView.props.ScreenToLocalTransform().Scale;
let doc = docView.props.Document
//TODO: make sure to test if the parent view is a freeform view. if not, just skip to the next level
if (docView.props.ContainingCollectionView.collectionViewType == CollectionViewType.Freeform) {
//scale of parent
-
- XView = (-doc.GetNumber(KeyStore.X, 0) * scale) + (parentWidth / 2) - (width * scale / 2);
- YView = (-doc.GetNumber(KeyStore.Y, 0) * scale) + (parentHeight / 2) - (height * scale / 2);
+ console.log("scale: " + scale)
+ XView = (-doc.GetNumber(KeyStore.X, 0) * scale) - (width * scale / 2);
+ YView = (-doc.GetNumber(KeyStore.Y, 0) * scale) - (height * scale / 2);
+ console.log("width: " + width)
+ console.log("height: " + height)
+ // XView = (-doc.GetNumber(KeyStore.X, 0) * scale) + (parentWidth / 2) - (width * scale / 2);
+ // YView = (-doc.GetNumber(KeyStore.Y, 0) * scale) + (parentHeight / 2) - (height * scale / 2);
// //node.Parent.setViewportXY(XView, YView);
DocumentManager.Instance.setViewportXY(docView.props.ContainingCollectionView, XView, YView)
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index b8896d50a..64bcbc24f 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -133,6 +133,7 @@ Documents.initProtos(() => {
isTopMost={true}
ContainingCollectionView={undefined} />
<DocumentDecorations />
+ <TempTreeView />
<ContextMenu />
<div style={{ position: 'absolute', bottom: '0px', left: '0px', width: '150px' }} ref={imgRef} >
<button onPointerDown={onRowDown(addImageNode, imgRef)} onClick={addClick(addImageNode)}>Add Image</button></div>
diff --git a/src/client/views/TempTreeView.scss b/src/client/views/TempTreeView.scss
index fe8cf4da8..0a6342ca6 100644
--- a/src/client/views/TempTreeView.scss
+++ b/src/client/views/TempTreeView.scss
@@ -5,6 +5,7 @@
z-index: 100;
position: fixed;
bottom: 0px;
+ right: 0px;
.list {
padding: 5px;
color: #1e5162;
diff --git a/src/client/views/TempTreeView.tsx b/src/client/views/TempTreeView.tsx
index 4b1650ac5..17e05068a 100644
--- a/src/client/views/TempTreeView.tsx
+++ b/src/client/views/TempTreeView.tsx
@@ -6,12 +6,9 @@ import { ListField } from "../../fields/ListField";
import "./TempTreeView.scss"
import { DocumentManager } from "./DocumentManager";
-export interface IProps {
- mainCollection: Array<Document>;
-}
@observer
-export class TempTreeView extends React.Component<IProps>{
+export class TempTreeView extends React.Component {
@action
onClick(doc: Document) {