Skip to content

Commit

Permalink
Add meta key to the possible multi selection keys on NME (#12657)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolhmj committed Jun 16, 2022
1 parent 0a75c11 commit fcd1148
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/tools/nodeEditor/src/diagram/graphCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
private _frames: GraphFrame[] = [];

private _altKeyIsPressed = false;
private _ctrlKeyIsPressed = false;
private _multiKeyIsPressed = false;
private _oldY = -1;

public _frameIsMoving = false;
Expand Down Expand Up @@ -232,7 +232,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
}
} else {
if (selection instanceof GraphFrame) {
if (this._ctrlKeyIsPressed || forceKeepSelection) {
if (this._multiKeyIsPressed || forceKeepSelection) {
if (!this._selectedFrameAndNodesConflict([selection], this._selectedNodes) && !this._selectedFrames.includes(selection)) {
this._selectedFrames.push(selection);
}
Expand All @@ -243,7 +243,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
this._selectedPort = null;
}
} else if (selection instanceof GraphNode) {
if (this._ctrlKeyIsPressed || forceKeepSelection) {
if (this._multiKeyIsPressed || forceKeepSelection) {
if (!this._selectedFrameAndNodesConflict(this._selectedFrames, [selection]) && !this._selectedNodes.includes(selection)) {
this._selectedNodes.push(selection);
}
Expand Down Expand Up @@ -272,15 +272,15 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
"keydown",
(evt) => {
this._altKeyIsPressed = evt.altKey;
this._ctrlKeyIsPressed = evt.ctrlKey;
this._multiKeyIsPressed = evt.ctrlKey || evt.metaKey;
},
false
);
this.props.globalState.hostDocument!.defaultView!.addEventListener(
"blur",
() => {
this._altKeyIsPressed = false;
this._ctrlKeyIsPressed = false;
this._multiKeyIsPressed = false;
},
false
);
Expand Down Expand Up @@ -369,7 +369,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP

onKeyUp() {
this._altKeyIsPressed = false;
this._ctrlKeyIsPressed = false;
this._multiKeyIsPressed = false;
this._oldY = -1;
}

Expand Down

0 comments on commit fcd1148

Please sign in to comment.