Commit 602cccbe authored by SergeyLuzyanin's avatar SergeyLuzyanin

connectors

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