diff options
-rw-r--r-- | src/client/views/collections/CollectionFreeFormView.tsx | 1 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 12 | ||||
-rw-r--r-- | src/temp.txt | 109 |
3 files changed, 0 insertions, 122 deletions
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx index 1b39dcae5..c81da5a57 100644 --- a/src/client/views/collections/CollectionFreeFormView.tsx +++ b/src/client/views/collections/CollectionFreeFormView.tsx @@ -35,7 +35,6 @@ export class CollectionFreeFormView extends CollectionViewBase { private _downX: number = 0; @observable private _downY: number = 0; - private _borderColor: string = "red" //determines whether the blinking cursor for indicating whether a text will be made on key down is visible @observable diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 9244ca08d..6ee313522 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -87,16 +87,6 @@ export function FakeJsxArgs(keys: string[], fields: string[] = []): JsxArgs { @observer export class DocumentView extends React.Component<DocumentViewProps> { - public Id: string = Utils.GenerateGuid(); - - @observable - public Border: string = "white" - - @action - public switchColor() { - this.Border = "red" - } - private _mainCont = React.createRef<HTMLDivElement>(); private _documentBindings: any = null; private _downX: number = 0; @@ -109,7 +99,6 @@ export class DocumentView extends React.Component<DocumentViewProps> { @computed get layoutFields(): Key[] { return this.props.Document.GetData(KeyStore.LayoutFields, ListField, new Array<Key>()); } screenRect = (): ClientRect | DOMRect => this._mainCont.current ? this._mainCont.current.getBoundingClientRect() : new DOMRect(); - size = (): { width: number, height: number } => this._mainCont.current ? { width: this._mainCont.current.clientWidth, height: this._mainCont.current.clientHeight } : { width: 0, height: 0 }; onPointerDown = (e: React.PointerEvent): void => { this._downX = e.clientX; @@ -248,7 +237,6 @@ export class DocumentView extends React.Component<DocumentViewProps> { ...this.props, isSelected: this.isSelected, select: this.select, - documentSize: this.size, focus: this.props.focus }; for (const key of this.layoutKeys) { diff --git a/src/temp.txt b/src/temp.txt deleted file mode 100644 index 481424859..000000000 --- a/src/temp.txt +++ /dev/null @@ -1,109 +0,0 @@ -= - //NAV - /** - * This method takes the node passed in as a parameter and centers it in the view. It is recursive - * so if the node is nested in collections, its parents will be centered too. - */ - public CenterNode(node: NodeStore) { - - let scale: number; - let XView: number; - let YView: number; - - //base case: parent is main - if(node.Parent == RootStore.Instance.MainNodeCollection){ - scale = RootStore.Instance.MainNodeCollection.Scale; - XView =(-node.X * scale) + (window.innerWidth / 2) - (node.Width * scale / 2 ) ; - YView = (-node.Y * scale) +(window.innerHeight / 2) - (node.Height * scale / 2) ; - RootStore.Instance.MainNodeCollection.SetViewportXY(XView, YView); - } - //parent is not main, parent is centered and calls itself - else{ - scale = node.Parent.Scale; - XView = (-node.X * scale) + (node.Parent.Width / 2) - (node.Width * scale / 2 ); - YView = (-node.Y * scale) +(node.Parent.Height / 2) - (node.Height * scale / 2); - node.Parent.SetViewportXY(XView, YView); - - return this.CenterNode(node.Parent); - } - - } - - @observable - public SetViewportXY(x: number, y: number) { - this.ViewportX = x; - this.ViewportY = y; - } - - - //NAV - /** - * This method sets the position of the new node to the center of the window/collection - * it is in. - */ - private SetPosition(node: NodeStore){ - let windowWidth: number; - let windowHeight: number; - let cornerX: number; - let cornerY: number; - - //size of parent is size of window if parent is root - if (node.Parent === RootStore.Instance.MainNodeCollection) { - windowWidth = window.innerWidth; - windowHeight = window.innerHeight; - } - //size of parent is size of collection node if not main - else { - windowWidth = node.Parent.Width; - windowHeight = node.Parent.Height; - } - - //corner of the parent's viewport (top left) - cornerX = node.Parent.ViewportX; - cornerY = node.Parent.ViewportY; - - //calculates node's position - let x = (windowWidth / 2 - cornerX) / node.Parent.Scale - node.Width / 2; - let y = (windowHeight / 2 - cornerY) / node.Parent.Scale - node.Height / 2; - - //sets node's position - node.X = x; - node.Y = y; - } - - /** - * This method finds the collection that has a name corresponding with the string - * passed in as a parameter. - */ - private findCollection(name: string): NodeCollectionStore { - - for (let cur of RootStore.Instance.Collections) { - if (name === cur.Title) { - return cur; - } - } - - return null; - } - - //NAV - /** - * This method resets all of the Z indices of the nodes to 0 so that one of them could be brought forward. - */ - @observable - private resetZIndices() { - for (let node of RootStore.Instance.Nodes) { - node.zIndex = 0; - } - } - - //NAV - /** - * This method brings the node passed in as a parameter to the front by resetting all of the - * z indices to 0, and then setting the one passed in to have a z index of 1 - */ - @observable - public bringForward(node: NodeStore) { - this.resetZIndices(); - node.zIndex = 1; - }
\ No newline at end of file |