Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
3c8d48b1
Commit
3c8d48b1
authored
Jan 31, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed shape
parent
2dd1b800
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
layout.default.js
src/module/layout.default.js
+21
-8
No files found.
src/module/layout.default.js
View file @
3c8d48b1
...
...
@@ -92,8 +92,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
underline
=
this
.
_underline
=
new
kity
.
Path
();
var
highlightshape
=
this
.
_highlightshape
=
new
kity
.
Rect
();
container
.
addShapes
(
[
highlightshape
,
underline
,
txt
]
);
minder
.
getRenderContainer
().
addShape
(
connect
).
bringTop
(
minder
.
getRoot
().
getRenderContainer
()
);
var
connect
=
this
.
_connect
=
new
kity
.
Path
();
minder
.
getRenderContainer
().
addShape
(
connect
).
bringTop
(
minder
.
getRoot
().
getRenderContainer
()
);
var
Layout
=
{
radius
:
10
,
fill
:
"skyblue"
,
...
...
@@ -102,7 +102,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
color
:
"#ccc"
,
padding
:
[
5
,
10
,
5
,
10
],
fontSize
:
12
,
margin
:
[
0
,
0
,
5
,
10
],
margin
:
[
0
,
10
,
20
,
5
],
shape
:
this
,
align
:
(
"leftright"
).
replace
(
node
.
getData
(
"layout"
).
appendside
,
""
),
appendside
:
node
.
getData
(
"layout"
).
appendside
...
...
@@ -137,13 +137,26 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
connect
=
this
.
_connect
;
var
node
=
this
.
_node
;
var
parentShape
=
node
.
getParent
().
getRenderContainer
();
var
parentBox
=
parentShape
.
getRenderBox
();
var
parentLayout
=
node
.
getParent
().
getData
(
"layout"
);
var
sX
,
sY
=
parentLayout
.
y
-
parentShape
.
getHeight
()
/
2
;
var
Layout
=
node
.
getData
(
"layout"
);
var
Shape
=
node
.
getRenderContainer
();
var
sX
,
sY
=
parentLayout
.
y
;
var
nodeX
,
nodeY
=
Shape
.
getRenderBox
().
closurePoints
[
1
].
y
;
if
(
node
.
appendside
===
"left"
)
{
sX
=
parentBox
.
closurePoints
[
1
].
x
+
parentLayout
.
margin
[
1
];
nodeX
=
Shape
.
getRenderBox
().
closurePoints
[
0
].
x
-
1
;
}
else
{
sX
=
parentBox
.
closurePoints
[
0
].
x
+
parentLayout
.
margin
[
1
];
nodeX
=
Shape
.
getRenderBox
().
closurePoints
[
1
].
x
+
1
;
}
connect
.
getDrawer
()
.
clear
()
.
moveTo
(
sX
,
sY
)
.
lineTo
(
sX
,
nodeY
>
sY
?
(
nodeY
-
Layout
.
margin
[
3
]
)
:
(
nodeY
+
Layout
.
margin
[
3
]
)
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
);
else
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
,
0
,
1
);
connect
.
stroke
(
Layout
.
stroke
);
},
clear
:
function
()
{
this
.
_node
.
getRenderContainer
().
clear
();
...
...
@@ -172,7 +185,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
fontSize
:
20
,
fill
:
"burlywood"
,
stroke
:
new
kity
.
Pen
(
"white"
,
1
),
padding
:
[
10.5
,
20
,
10.5
,
2
0
],
padding
:
[
10.5
,
10
,
10.5
,
1
0
],
radius
:
15
,
margin
:
[
0
,
0
,
0
,
0
]
};
...
...
@@ -290,10 +303,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
parentX
=
parentLayout
.
x
;
switch
(
appendside
)
{
case
"left"
:
nodeLayout
.
x
=
parentX
-
parentWidth
-
node
Layout
.
margin
[
1
]
-
nodeLayout
.
margin
[
3
];
nodeLayout
.
x
=
parentX
-
parentWidth
-
parent
Layout
.
margin
[
1
]
-
nodeLayout
.
margin
[
3
];
break
;
case
"right"
:
nodeLayout
.
x
=
parentX
+
parentWidth
+
node
Layout
.
margin
[
1
]
+
nodeLayout
.
margin
[
3
];
nodeLayout
.
x
=
parentX
+
parentWidth
+
parent
Layout
.
margin
[
1
]
+
nodeLayout
.
margin
[
3
];
break
;
default
:
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment