Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
36dbc41f
Z
zui
项目概览
易企天创
/
zui
大约 1 年 前同步成功
通知
6
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
37
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
37
Issue
37
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
36dbc41f
编写于
11月 05, 2019
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* fix relationLineGap option not work.
上级
0479a5ea
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
23 deletion
+26
-23
src/js/flowchart.js
src/js/flowchart.js
+26
-23
未找到文件。
src/js/flowchart.js
浏览文件 @
36dbc41f
...
...
@@ -1042,17 +1042,17 @@ if (!Array.prototype.map) {
relation
.
fromSide
=
fromSide
;
relation
.
toSide
=
toSide
;
var
beginNode
=
isReverse
?
toNode
:
fromNode
;
var
endNode
=
isReverse
?
fromNode
:
toNode
;
var
beginBounds
=
beginNode
.
bounds
;
var
endBounds
=
endNode
.
bounds
;
var
beginSide
=
isReverse
?
toSide
:
fromSide
;
var
endSide
=
isReverse
?
fromSide
:
toSide
;
var
betterLines
=
options
.
relationLineGap
;
var
beginSideRels
=
betterLines
&&
beginNode
.
sideRels
[
beginSide
];
var
endSideRels
=
betterLines
&&
endNode
.
sideRels
[
endSide
];
if
(
betterLines
)
{
var
beginNode
=
isReverse
?
toNode
:
fromNode
;
var
endNode
=
isReverse
?
fromNode
:
toNode
;
var
beginBounds
=
beginNode
.
bounds
;
var
endBounds
=
endNode
.
bounds
;
var
beginSide
=
isReverse
?
toSide
:
fromSide
;
var
endSide
=
isReverse
?
fromSide
:
toSide
;
var
relationLineGap
=
options
.
relationLineGap
;
var
beginSideRels
=
relationLineGap
&&
beginNode
.
sideRels
[
beginSide
];
var
endSideRels
=
relationLineGap
&&
endNode
.
sideRels
[
endSide
];
if
(
relationLineGap
)
{
var
findRelById
=
function
(
rel
)
{
return
rel
.
id
===
relation
.
id
;
};
...
...
@@ -1098,10 +1098,10 @@ if (!Array.prototype.map) {
endSideRels
.
sort
(
sortRels
);
}
}
var
beginSideRelIndex
=
betterLines
&&
beginSideRels
.
findIndex
(
findRelById
);
var
endSideRelIndex
=
betterLines
&&
endSideRels
.
findIndex
(
findRelById
);
var
beginSideRelsCount
=
betterLines
?
beginSideRels
.
length
:
0
;
var
endSideRelsCount
=
betterLines
?
endSideRels
.
length
:
0
;
var
beginSideRelIndex
=
relationLineGap
&&
beginSideRels
.
findIndex
(
findRelById
);
var
endSideRelIndex
=
relationLineGap
&&
endSideRels
.
findIndex
(
findRelById
);
var
beginSideRelsCount
=
relationLineGap
?
beginSideRels
.
length
:
0
;
var
endSideRelsCount
=
relationLineGap
?
endSideRels
.
length
:
0
;
relation
.
beginSideRels
=
beginSideRels
;
relation
.
endSideRels
=
endSideRels
;
...
...
@@ -1140,8 +1140,11 @@ if (!Array.prototype.map) {
background
:
lineColor
,
position
:
'
absolute
'
,
};
var
beginLineOffset
=
betterLines
?
(
1
-
beginSideRelsCount
+
2
*
beginSideRelIndex
)
*
2
:
0
;
var
endLineOffset
=
betterLines
?
(
1
-
endSideRelsCount
+
2
*
endSideRelIndex
)
*
2
:
0
;
var
beginLineOffset
=
relationLineGap
?
(
1
-
beginSideRelsCount
+
2
*
beginSideRelIndex
)
*
relationLineGap
:
0
;
var
endLineOffset
=
relationLineGap
?
(
1
-
endSideRelsCount
+
2
*
endSideRelIndex
)
*
relationLineGap
:
0
;
relation
.
beginLineOffset
=
beginLineOffset
;
relation
.
endLineOffset
=
endLineOffset
;
if
(
direction
===
'
bottom-left
'
||
direction
===
'
top-right
'
)
{
// Relation link as ┘
bounds
.
left
=
beginBounds
.
right
;
...
...
@@ -1151,10 +1154,10 @@ if (!Array.prototype.map) {
beginLineStyle
.
left
=
isReverse
?
arrowSize
:
0
;
beginLineStyle
.
top
=
Math
.
floor
(
beginBounds
.
centerTop
-
bounds
.
top
-
lineSize
/
2
)
+
beginLineOffset
;
beginLineStyle
.
width
=
Math
.
floor
(
bounds
.
width
-
lineSize
-
endBounds
.
width
/
2
)
-
beginLineStyle
.
left
;
beginLineStyle
.
width
=
Math
.
floor
(
bounds
.
width
-
lineSize
-
endBounds
.
width
/
2
)
-
beginLineStyle
.
left
+
endLineOffset
;
beginLineStyle
.
height
=
lineSize
;
endLineStyle
.
left
=
beginLineStyle
.
width
+
beginLineStyle
.
left
+
endLineOffset
;
endLineStyle
.
left
=
beginLineStyle
.
width
+
beginLineStyle
.
left
;
endLineStyle
.
top
=
isReverse
?
0
:
arrowSize
;
endLineStyle
.
width
=
lineSize
;
endLineStyle
.
height
=
beginLineStyle
.
top
-
endLineStyle
.
top
;
...
...
@@ -1196,10 +1199,10 @@ if (!Array.prototype.map) {
beginLineStyle
.
left
=
Math
.
floor
(
beginBounds
.
width
/
2
-
lineSize
)
+
beginLineOffset
;
beginLineStyle
.
top
=
isReverse
?
arrowSize
:
0
;
beginLineStyle
.
width
=
lineSize
;
beginLineStyle
.
height
=
Math
.
floor
(
endBounds
.
centerTop
-
bounds
.
top
-
lineSize
/
2
)
-
beginLineStyle
.
top
;
beginLineStyle
.
height
=
Math
.
floor
(
endBounds
.
centerTop
-
bounds
.
top
-
lineSize
/
2
)
-
beginLineStyle
.
top
+
endLineOffset
;
endLineStyle
.
left
=
beginLineStyle
.
left
+
lineSize
;
endLineStyle
.
top
=
beginLineStyle
.
top
+
beginLineStyle
.
height
+
endLineOffset
;
endLineStyle
.
top
=
beginLineStyle
.
top
+
beginLineStyle
.
height
;
endLineStyle
.
width
=
Math
.
floor
(
bounds
.
width
-
lineSize
-
beginLineStyle
.
left
)
-
(
isReverse
?
0
:
arrowSize
);
endLineStyle
.
height
=
lineSize
;
...
...
@@ -1405,13 +1408,13 @@ if (!Array.prototype.map) {
if
(
element
)
{
partialsMap
[
elementId
]
=
element
;
if
(
element
.
type
!==
'
relation
'
)
{
var
betterLines
=
options
.
relationLineGap
;
var
relationLineGap
=
options
.
relationLineGap
;
var
addRelToPartialMap
=
function
(
rel
)
{
partialsMap
[
rel
.
id
]
=
rel
;
};
var
addRel
=
function
(
rel
)
{
addRelToPartialMap
(
rel
);
if
(
betterLines
)
{
if
(
relationLineGap
)
{
if
(
rel
.
beginSideRels
)
{
rel
.
beginSideRels
.
forEach
(
addRelToPartialMap
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录