Skip to content

Commit

Permalink
fixing first sharded UI
Browse files Browse the repository at this point in the history
  • Loading branch information
msDestiny14 committed Dec 17, 2020
1 parent d807c91 commit 7cd5e82
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as React from "react";
import { GlobalState } from '../../globalState';
import { Nullable } from 'babylonjs/types';
import { ButtonLineComponent } from '../../sharedComponents/buttonLineComponent';
import { ButtonLineComponent } from '../../sharedUiComponents/lines/buttonLineComponent';
import { LineContainerComponent } from '../../sharedComponents/lineContainerComponent';
import { FileButtonLineComponent } from '../../sharedComponents/fileButtonLineComponent';
import { Tools } from 'babylonjs/Misc/tools';
Expand Down
4 changes: 0 additions & 4 deletions guiEditor/src/diagram/guiNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ export class GUINode {
this.guiNode.topInPixels = this.y;
}

public appendVisual(root: HTMLDivElement, owner: WorkbenchComponent) {
this._ownerCanvas = owner;
}

public dispose() {
// notify frame observers that this node is being deleted
this._globalState.onGraphNodeRemovalObservable.notifyObservers(this);
Expand Down
10 changes: 5 additions & 5 deletions guiEditor/src/diagram/workbench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
private readonly MaxZoom = 4;

private _hostCanvas: HTMLDivElement;
private _graphCanvas: HTMLDivElement;
private _gridCanvas: HTMLDivElement;
private _selectionContainer: HTMLDivElement;
private _frameContainer: HTMLDivElement;
private _svgCanvas: HTMLElement;
Expand Down Expand Up @@ -118,7 +118,7 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
}

public get canvasContainer() {
return this._graphCanvas;
return this._gridCanvas;
}

public get hostCanvas() {
Expand Down Expand Up @@ -238,13 +238,12 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
node.dispose();
}
this._guiNodes = [];
this._graphCanvas.innerHTML = "";
this._gridCanvas.innerHTML = "";
this._svgCanvas.innerHTML = "";
}

appendBlock(guiElement: Control) {
var newGuiNode = new GUINode(this.props.globalState, guiElement);
newGuiNode.appendVisual(this._graphCanvas, this);
this._guiNodes.push(newGuiNode);
this.globalState.guiTexture.addControl(guiElement);
return newGuiNode;
Expand Down Expand Up @@ -298,7 +297,7 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
componentDidMount() {
this._hostCanvas = this.props.globalState.hostDocument.getElementById("graph-canvas") as HTMLDivElement;
this._rootContainer = this.props.globalState.hostDocument.getElementById("graph-container") as HTMLDivElement;
this._graphCanvas = this.props.globalState.hostDocument.getElementById("graph-canvas-container") as HTMLDivElement;
this._gridCanvas = this.props.globalState.hostDocument.getElementById("graph-canvas-container") as HTMLDivElement;
this._svgCanvas = this.props.globalState.hostDocument.getElementById("graph-svg-container") as HTMLElement;
this._selectionContainer = this.props.globalState.hostDocument.getElementById("selection-container") as HTMLDivElement;
this._frameContainer = this.props.globalState.hostDocument.getElementById("frame-container") as HTMLDivElement;
Expand Down Expand Up @@ -386,6 +385,7 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
onDown(evt: React.PointerEvent<HTMLElement>) {
this._rootContainer.setPointerCapture(evt.pointerId);

//TODO: Inplement group selection
// Selection?
/*if (evt.currentTarget === this._hostCanvas && evt.ctrlKey) {
this._selectionBox = this.props.globalState.hostDocument.createElement("div");
Expand Down
21 changes: 0 additions & 21 deletions guiEditor/src/sharedComponents/buttonLineComponent.tsx

This file was deleted.

1 change: 1 addition & 0 deletions guiEditor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../tsconfigRules",
"compilerOptions": {
"preserveSymlinks": false,
"jsx": "react",
"baseUrl": "./src/",
"rootDir": "./src/",
Expand Down
1 change: 1 addition & 0 deletions guiEditor/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const babylonWebpackConfig = require('../Tools/WebpackPlugins/babylonWebpackConf
var config = babylonWebpackConfig({
module: "guiEditor",
resolve: {
symlinks: false,
extensions: [".js", '.ts', ".tsx"],
},
moduleRules: [
Expand Down

0 comments on commit 7cd5e82

Please sign in to comment.