Commit db301e93 authored by SergeyLuzyanin's avatar SergeyLuzyanin

calculation connectors params

parent abbd6c43
...@@ -679,7 +679,7 @@ function getTargetTextObject(controller) ...@@ -679,7 +679,7 @@ function getTargetTextObject(controller)
function isConnectorPreset(sPreset){ function isConnectorPreset(sPreset){
if(typeof sPreset === "string" && sPreset.length > 0){ if(typeof sPreset === "string" && sPreset.length > 0){
return "line" === sPreset || sPreset.toLowerCase().indexOf("connector") > -1; return (sPreset.toLowerCase().indexOf("line") > -1 || sPreset.toLowerCase().indexOf("connector") > -1);
} }
return false; return false;
} }
......
...@@ -128,19 +128,15 @@ ...@@ -128,19 +128,15 @@
_begin.transform(oTransform); _begin.transform(oTransform);
_end.transform(oTransform); _end.transform(oTransform);
var posX = Math.min(_begin.x, _end.x);
var posY = Math.min(_begin.y, _end.y);
var extX = Math.max(penW/36000.0, Math.abs(_end.x - _begin.x)); var extX = Math.max(penW/36000.0, Math.abs(_end.x - _begin.x));
var extY = Math.max(penW/36000.0, Math.abs(_end.y - _begin.y)); var extY = Math.max(penW/36000.0, Math.abs(_end.y - _begin.y));
var flipV = false; var flipV = false;
var flipH = false; var flipH = false;
var rot = 0; var rot = 0;
var oMapAdj = {}; var oMapAdj = {};
var tmp;
var xc = posX + extX/2, yc = posY + extY/2;
if(sPreset === "line"){ if(sPreset === "line"){
flipH = (begin.x > _end.x); flipH = (_begin.x > _end.x);
flipV = (begin.y > _end.y); flipV = (_begin.y > _end.y);
} }
else{ else{
var sPrefix = "bentConnector"; var sPrefix = "bentConnector";
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
_endConnectionParams = this.endShape.convertToConnectionParams(this.endShape.rot, this.endShape.transform, this.endShape.bounds, g_conn_info); _endConnectionParams = this.endShape.convertToConnectionParams(this.endShape.rot, this.endShape.transform, this.endShape.bounds, g_conn_info);
} }
else { else {
_endConnectionParams = AscFormat.fCalculateConnectionInfo(_endConnectionParams, this.endX, this.endY); _endConnectionParams = AscFormat.fCalculateConnectionInfo(_startConnectionParams, this.endX, this.endY);
} }
} }
this.oSpPr = AscFormat.fCalculateSpPr(_startConnectionParams, _endConnectionParams, this.connector.spPr.geometry.preset, this.overlayObject.pen.w); this.oSpPr = AscFormat.fCalculateSpPr(_startConnectionParams, _endConnectionParams, this.connector.spPr.geometry.preset, this.overlayObject.pen.w);
......
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