onresize
This commit is contained in:
parent
e6d8e0fa98
commit
bbe3500928
2 changed files with 10 additions and 3 deletions
|
@ -61,7 +61,7 @@ var DiagramNode = /** @class */ (function () {
|
||||||
}());
|
}());
|
||||||
var _diagram;
|
var _diagram;
|
||||||
function diargramOnResize() {
|
function diargramOnResize() {
|
||||||
_diagram.fillParent();
|
_diagram.onresize();
|
||||||
}
|
}
|
||||||
function diagramOnMouseDown(ev) {
|
function diagramOnMouseDown(ev) {
|
||||||
_diagram.onmousedown(ev);
|
_diagram.onmousedown(ev);
|
||||||
|
@ -331,6 +331,9 @@ var Diagrams = /** @class */ (function () {
|
||||||
Diagrams.prototype.removeConnection = function (A, B) {
|
Diagrams.prototype.removeConnection = function (A, B) {
|
||||||
this.connections.splice(this.connections.indexOf([A, B]), 1);
|
this.connections.splice(this.connections.indexOf([A, B]), 1);
|
||||||
};
|
};
|
||||||
|
Diagrams.prototype.onresize = function () {
|
||||||
|
this.fillParent();
|
||||||
|
};
|
||||||
Diagrams.prototype.fillParent = function () {
|
Diagrams.prototype.fillParent = function () {
|
||||||
this.canvas.width = this.canvas.clientWidth;
|
this.canvas.width = this.canvas.clientWidth;
|
||||||
this.canvas.height = this.canvas.clientHeight;
|
this.canvas.height = this.canvas.clientHeight;
|
||||||
|
|
|
@ -85,7 +85,7 @@ class DiagramNode {
|
||||||
|
|
||||||
let _diagram: Diagrams;
|
let _diagram: Diagrams;
|
||||||
function diargramOnResize(){
|
function diargramOnResize(){
|
||||||
_diagram.fillParent();
|
_diagram.onresize();
|
||||||
}
|
}
|
||||||
function diagramOnMouseDown(ev: MouseEvent){
|
function diagramOnMouseDown(ev: MouseEvent){
|
||||||
_diagram.onmousedown(ev);
|
_diagram.onmousedown(ev);
|
||||||
|
@ -397,6 +397,10 @@ class Diagrams {
|
||||||
this.connections.splice(this.connections.indexOf([A, B]), 1);
|
this.connections.splice(this.connections.indexOf([A, B]), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onresize(){
|
||||||
|
this.fillParent();
|
||||||
|
}
|
||||||
|
|
||||||
fillParent(){
|
fillParent(){
|
||||||
this.canvas.width = this.canvas.clientWidth;
|
this.canvas.width = this.canvas.clientWidth;
|
||||||
this.canvas.height = this.canvas.clientHeight;
|
this.canvas.height = this.canvas.clientHeight;
|
||||||
|
|
Loading…
Add table
Reference in a new issue