Browse Source

selection

Pamela Wolf 4 years ago
parent
commit
3fc4c235a9
2 changed files with 7 additions and 3 deletions
  1. 5 1
      guiEditor/src/diagram/graphCanvas.tsx
  2. 2 2
      guiEditor/src/diagram/graphNode.ts

+ 5 - 1
guiEditor/src/diagram/graphCanvas.tsx

@@ -183,7 +183,11 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
     constructor(props: IGraphCanvasComponentProps) {
         super(props);
 
-        props.globalState.onSelectionChangedObservable.add(selection => {            
+        props.globalState.onSelectionChangedObservable.add(selection => {  
+            this.selectedGuiNodes.forEach(element => {
+                element.isSelected = false;
+            }); 
+            //this._selectedGuiNodes = [];
             if (!selection) {
                 this._selectedNodes = [];
                 this._selectedGuiNodes = [];

+ 2 - 2
guiEditor/src/diagram/graphNode.ts

@@ -161,12 +161,12 @@ export class GraphNode {
         this._isSelected = value;
 
         if (!value) {
-            this._visual.classList.remove("selected");    
+            /*this._visual.classList.remove("selected");    
             let indexInSelection = this._ownerCanvas.selectedNodes.indexOf(this);
 
             if (indexInSelection > -1) {
                 this._ownerCanvas.selectedNodes.splice(indexInSelection, 1);
-            }
+            }*/
         } else {
             this._globalState.onSelectionChangedObservable.notifyObservers(this);  
         }