|
@@ -78,7 +78,7 @@ export class GraphFrame {
|
|
port.delegatedPort = localPort;
|
|
port.delegatedPort = localPort;
|
|
this._controlledPorts.push(port);
|
|
this._controlledPorts.push(port);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public set isCollapsed(value: boolean) {
|
|
public set isCollapsed(value: boolean) {
|
|
if (this._isCollapsed === value) {
|
|
if (this._isCollapsed === value) {
|
|
return;
|
|
return;
|
|
@@ -135,7 +135,7 @@ export class GraphFrame {
|
|
} else {
|
|
} else {
|
|
this._createInputPort(port, node);
|
|
this._createInputPort(port, node);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.element.classList.remove("collapsed");
|
|
this.element.classList.remove("collapsed");
|
|
@@ -489,7 +489,7 @@ export class GraphFrame {
|
|
this._ownerCanvas._frameIsMoving = true;
|
|
this._ownerCanvas._frameIsMoving = true;
|
|
|
|
|
|
this.move(this._ownerCanvas.getGridPosition(this.x), this._ownerCanvas.getGridPosition(this.y))
|
|
this.move(this._ownerCanvas.getGridPosition(this.x), this._ownerCanvas.getGridPosition(this.y))
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
public move(newX: number, newY: number, align = true) {
|
|
public move(newX: number, newY: number, align = true) {
|
|
let oldX = this.x;
|
|
let oldX = this.x;
|
|
@@ -587,6 +587,9 @@ export class GraphFrame {
|
|
private _onRightHandlePointerDown = (evt: PointerEvent) => {
|
|
private _onRightHandlePointerDown = (evt: PointerEvent) => {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.initResizing(evt);
|
|
this.initResizing(evt);
|
|
_this._resizingDirection = ResizingDirection.Right;
|
|
_this._resizingDirection = ResizingDirection.Right;
|
|
_this.mouseXLimit = evt.clientX - (_this.width - _this._minFrameWidth);
|
|
_this.mouseXLimit = evt.clientX - (_this.width - _this._minFrameWidth);
|
|
@@ -630,6 +633,9 @@ export class GraphFrame {
|
|
private _onBottomHandlePointerDown = (evt: PointerEvent) => {
|
|
private _onBottomHandlePointerDown = (evt: PointerEvent) => {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this.initResizing(evt);
|
|
_this.initResizing(evt);
|
|
_this._resizingDirection = ResizingDirection.Bottom;
|
|
_this._resizingDirection = ResizingDirection.Bottom;
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onBottomHandlePointerMove);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onBottomHandlePointerMove);
|
|
@@ -671,6 +677,9 @@ export class GraphFrame {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.initResizing(evt);
|
|
_this.initResizing(evt);
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this._resizingDirection = ResizingDirection.Left;
|
|
_this._resizingDirection = ResizingDirection.Left;
|
|
_this.mouseXLimit = evt.clientX + _this.width - _this._minFrameWidth;
|
|
_this.mouseXLimit = evt.clientX + _this.width - _this._minFrameWidth;
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onLeftHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onLeftHandlePointerUp);
|
|
@@ -715,6 +724,9 @@ export class GraphFrame {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.initResizing(evt);
|
|
_this.initResizing(evt);
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this._resizingDirection = ResizingDirection.Top;
|
|
_this._resizingDirection = ResizingDirection.Top;
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onTopHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onTopHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onTopHandlePointerMove);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onTopHandlePointerMove);
|
|
@@ -756,6 +768,9 @@ export class GraphFrame {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.initResizing(evt);
|
|
_this.initResizing(evt);
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this._resizingDirection = ResizingDirection.TopRight;
|
|
_this._resizingDirection = ResizingDirection.TopRight;
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onTopRightHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onTopRightHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onTopRightHandlePointerMove);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onTopRightHandlePointerMove);
|
|
@@ -814,6 +829,9 @@ export class GraphFrame {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.initResizing(evt);
|
|
_this.initResizing(evt);
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this._resizingDirection = ResizingDirection.BottomRight;
|
|
_this._resizingDirection = ResizingDirection.BottomRight;
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onBottomRightHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onBottomRightHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onBottomRightHandlePointerMove);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointermove", _this._onBottomRightHandlePointerMove);
|
|
@@ -871,6 +889,9 @@ export class GraphFrame {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.initResizing(evt);
|
|
_this.initResizing(evt);
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this._resizingDirection = ResizingDirection.BottomLeft;
|
|
_this._resizingDirection = ResizingDirection.BottomLeft;
|
|
_this.mouseXLimit = evt.clientX + _this.width - _this._minFrameWidth;
|
|
_this.mouseXLimit = evt.clientX + _this.width - _this._minFrameWidth;
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onBottomLeftHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onBottomLeftHandlePointerUp);
|
|
@@ -930,6 +951,9 @@ export class GraphFrame {
|
|
// tslint:disable-next-line: no-this-assignment
|
|
// tslint:disable-next-line: no-this-assignment
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.initResizing(evt);
|
|
_this.initResizing(evt);
|
|
|
|
+ if (_this.isCollapsed) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
_this._resizingDirection = ResizingDirection.TopLeft;
|
|
_this._resizingDirection = ResizingDirection.TopLeft;
|
|
_this.mouseXLimit = evt.clientX + _this.width - _this._minFrameWidth;
|
|
_this.mouseXLimit = evt.clientX + _this.width - _this._minFrameWidth;
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onTopLeftHandlePointerUp);
|
|
_this._ownerCanvas.hostCanvas.addEventListener("pointerup", _this._onTopLeftHandlePointerUp);
|