Commit 02d110f9 authored by SergeyLuzyanin's avatar SergeyLuzyanin

connector params

parent 474b1a34
......@@ -139,7 +139,8 @@
var tmp;
var xc = posX + extX/2, yc = posY + extY/2;
if(sPreset === "line"){
flipH = (begin.x > _end.x);
flipV = (begin.y > _end.y);
}
else{
var sPrefix = "bentConnector";
......@@ -253,16 +254,17 @@
posY = (_end.y + _begin.y)/2.0 - extY/2.0;
}
else{
sPreset = "4";
rot = Math.PI / 2.0;
tmp = extX;
extX = extY;
extY = tmp;
posX = (_end.x + _begin.x)/2.0 - extX/2.0;
posY = (_end.y + _begin.y)/2.0 - extY/2.0;
flipH = true;
oMapAdj["adj1"] = (-100000*((_end.bounds.b + CONNECTOR_MARGIN - _end.y)/extX) + 0.5) >> 0;
oMapAdj["adj2"] = 100000 - (100000*(((_begin.bounds.r + _end.bounds.l)/2 - (xc - extY/2))/extY) + 0.5) >> 0;
if(_end.y < _begin.y){
sPreset = "4";
flipV = true;
oMapAdj["adj2"] = -((100000*((_end.bounds.b + CONNECTOR_MARGIN - _end.y)/extY) + 0.5) >> 0);
oMapAdj["adj1"] = ((100000*(((_begin.bounds.r + _end.bounds.l)/2 - _begin.x))/extX) + 0.5) >> 0;
}
else{
sPreset = "4";
oMapAdj["adj1"] = (100000*(((_begin.bounds.r + _end.bounds.l)/2.0 - _begin.x)/extX) + 0.5) >> 0;
oMapAdj["adj2"] = 100000 + ((100000*((_end.bounds.b + CONNECTOR_MARGIN - _end.y)/extY) + 0.5) >> 0);
}
}
}
else{
......@@ -288,7 +290,7 @@
flipH = true;
oMapAdj["adj1"] = (100000*(((_begin.bounds.t + _end.bounds.b)/2 - (yc - extX/2))/extX) + 0.5) >> 0;
oMapAdj["adj2"] = 100000 + (100000*(Math.max(CONNECTOR_MARGIN, _end.bounds.r + CONNECTOR_MARGIN - _begin.x)/extY) + 0.5) >> 0;
oMapAdj["adj2"] = 100000 + (100000*(CONNECTOR_MARGIN/extY) + 0.5) >> 0;
}
}
else{
......@@ -317,17 +319,23 @@
}
}
else{
sPreset = "4";
rot = Math.PI / 2.0;
tmp = extX;
extX = extY;
extY = tmp;
posX = (_end.x + _begin.x)/2.0 - extX/2.0;
posY = (_end.y + _begin.y)/2.0 - extY/2.0;
flipH = true;
if(_end.y > _begin.y){
sPreset = "4";
rot = Math.PI / 2.0;
tmp = extX;
extX = extY;
extY = tmp;
posX = (_end.x + _begin.x)/2.0 - extX/2.0;
posY = (_end.y + _begin.y)/2.0 - extY/2.0;
flipH = true;
oMapAdj["adj1"] = -((100000*(Math.max(_begin.bounds.b, _end.bounds.b) + CONNECTOR_MARGIN - _end.y)/extX + 0.5) >> 0);
oMapAdj["adj2"] = -(100000*((Math.max(_begin.bounds.r, _end.bounds.r) + CONNECTOR_MARGIN - Math.max(_begin.x, _end.x))/extY) + 0.5) >> 0;
oMapAdj["adj1"] = -((100000*(Math.max(_begin.bounds.b, _end.bounds.b) + CONNECTOR_MARGIN - _end.y)/extX + 0.5) >> 0);
oMapAdj["adj2"] = -(100000*((Math.max(_begin.bounds.r, _end.bounds.r) + CONNECTOR_MARGIN - Math.max(_begin.x, _end.x))/extY) + 0.5) >> 0;
}
else{
sPreset = "2";
flipV = true;
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment