Commit 602cccbe authored by SergeyLuzyanin's avatar SergeyLuzyanin

connectors

parent 1a2d11a8
......@@ -151,18 +151,25 @@
case AscFormat.CARD_DIRECTION_N:{
if(_end.bounds.l > _begin.bounds.r){
if(_end.y <= _begin.y){
sPreset = "4";
rot = 3.0*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;
flipV = true;
oMapAdj["adj2"] = 100000 - (100000*(((_begin.bounds.r + _end.bounds.l)/2 - (xc - extY/2))/extY) + 0.5) >> 0;
oMapAdj["adj1"] = (-100000*( ( _end.y - (_end.bounds.t - CONNECTOR_MARGIN) )/extX) + 0.5) >> 0;
if(_end.bounds.t < _begin.y){
if(_end.y <= _begin.y){
sPreset = "4";
rot = 3.0*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;
flipV = true;
oMapAdj["adj2"] = 100000 - (100000*(((_begin.bounds.r + _end.bounds.l)/2 - (xc - extY/2))/extY) + 0.5) >> 0;
oMapAdj["adj1"] = (-100000*( ( _end.y - (_end.bounds.t - CONNECTOR_MARGIN) )/extX) + 0.5) >> 0;
}
else{
sPreset = "4";
oMapAdj["adj1"] = (100000*(((_begin.bounds.r + _end.bounds.l)/2 - _begin.x)/extX) + 0.5) >> 0;
oMapAdj["adj2"] = (-100000*( ( _begin.y - (_end.bounds.t - CONNECTOR_MARGIN) )/extY) + 0.5) >> 0;
}
}
else{
sPreset = "2";
......@@ -176,7 +183,7 @@
}
}
else{
if(_end.y <= _begin.bounds.b){
if(_end.bounds.t <= _begin.bounds.b){
if(_end.y <= _begin.y){
if(_end.x <= _begin.x){
......@@ -200,32 +207,36 @@
}
}
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;
flipV = true;
oMapAdj["adj1"] = 100000 + ((100000*((yc - extX/2 - (Math.min(_end.bounds.t, _begin.bounds.t) - CONNECTOR_MARGIN))/extX) + 0.5) >> 0);
oMapAdj["adj2"] = 100000 + (100000*(Math.max(CONNECTOR_MARGIN, _end.bounds.r + CONNECTOR_MARGIN - _begin.x)/extY) + 0.5) >> 0;
if(_end.x <= _begin.x){
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;
flipV = true;
oMapAdj["adj1"] = 100000 + ((100000*((yc - extX/2 - (Math.min(_end.bounds.t, _begin.bounds.t) - CONNECTOR_MARGIN))/extX) + 0.5) >> 0);
oMapAdj["adj2"] = 100000 + (100000*(Math.max(CONNECTOR_MARGIN, _end.bounds.r + CONNECTOR_MARGIN - _begin.x)/extY) + 0.5) >> 0;
}
else{
sPreset = "2";
}
}
}
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;
flipV = true;
oMapAdj["adj1"] = ((100000*(_end.y - (_end.bounds.t + _begin.bounds.b)/2)/extX) + 0.5) >> 0;
oMapAdj["adj2"] = 100000 + (100000*(CONNECTOR_MARGIN/extY) + 0.5) >> 0;
if(_end.x < _begin.x){
sPreset = "4";
flipH = true;
oMapAdj["adj1"] = -(100000*(Math.max(_end.bounds.r, _begin.bounds.r) + CONNECTOR_MARGIN - _begin.x)/extX + 0.5) >> 0;
oMapAdj["adj2"] = (100000*(((_begin.bounds.b + _end.bounds.t)/2 - _begin.y)/extY) + 0.5) >> 0;
}
else{
sPreset = "2";
}
}
}
break;
......
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