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
f608c0ab
Commit
f608c0ab
authored
May 04, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'kity-2.0' of
https://github.com/fex-team/kityminder
into dev
parents
59ce68ec
fffdc644
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
27 deletions
+27
-27
kity
kity
+1
-1
dragtree.js
src/module/dragtree.js
+1
-1
editor.receiver.js
src/module/editor.receiver.js
+1
-0
editor.selection.js
src/module/editor.selection.js
+1
-1
icon.js
src/module/icon.js
+6
-6
layout.bottom.js
src/module/layout.bottom.js
+6
-6
layout.default.js
src/module/layout.default.js
+9
-9
layout.js
src/module/layout.js
+1
-2
view.js
src/module/view.js
+1
-1
No files found.
kity
@
d478b95a
Subproject commit
741dc07c2094ea45a1d622763a64f4c021476dc1
Subproject commit
d478b95aca324ffc1c45f2dd6e1315fcf762a5fa
src/module/dragtree.js
View file @
f608c0ab
...
...
@@ -228,7 +228,7 @@ var DragBox = kity.createClass( "DragBox", {
var
movement
=
kity
.
Vector
.
fromPoints
(
this
.
_startPosition
,
this
.
_dragPosition
);
this
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
movement
.
x
,
movement
.
y
)
);
this
.
setTrans
late
(
movement
);
this
.
_dropTest
();
this
.
_updateDropHint
();
...
...
src/module/editor.receiver.js
View file @
f608c0ab
...
...
@@ -66,6 +66,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
},
setMinderNode
:
function
(
node
)
{
this
.
minderNode
=
node
;
node
.
addShape
(
this
.
textShape
);
return
this
;
},
keyboardEvents
:
function
(
e
)
{
...
...
src/module/editor.selection.js
View file @
f608c0ab
...
...
@@ -22,7 +22,7 @@ Minder.Selection = kity.createClass( 'Selection', {
this
.
width
=
1
;
this
.
collapsed
=
true
;
if
(
toEnd
){
this
.
startOffset
=
this
.
endOffset
this
.
startOffset
=
this
.
endOffset
;
}
else
{
this
.
endOffset
=
this
.
startOffset
;
}
...
...
src/module/icon.js
View file @
f608c0ab
...
...
@@ -6,9 +6,9 @@ KityMinder.registerModule( "IconModule", function () {
var
_rc
=
new
kity
.
Group
();
_rc
.
addShapes
(
[
_bg
,
_number
]
);
node
.
getContRc
().
addShape
(
_rc
);
_number
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
6
,
15
)
);
_number
.
setTrans
late
(
6
,
15
);
var
rcHeight
=
_rc
.
getHeight
();
_rc
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
0
,
-
rcHeight
/
2
)
);
_rc
.
setTrans
late
(
0
,
-
rcHeight
/
2
);
};
var
renderProgressIcon
=
function
(
node
,
val
)
{
...
...
@@ -27,13 +27,13 @@ KityMinder.registerModule( "IconModule", function () {
case
1
:
break
;
case
2
:
d
.
carcTo
(
6
,
0
,
-
6
);
d
.
carcTo
(
6
,
0
,
0
,
0
,
-
6
);
break
;
case
3
:
d
.
carcTo
(
6
,
-
6
,
0
);
d
.
carcTo
(
6
,
0
,
0
,
-
6
,
0
);
break
;
case
4
:
d
.
carcTo
(
6
,
0
,
6
,
1
,
0
);
d
.
carcTo
(
6
,
1
,
0
,
0
,
6
);
break
;
case
5
:
var
check
=
new
kity
.
Path
();
...
...
@@ -44,7 +44,7 @@ KityMinder.registerModule( "IconModule", function () {
}
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"#29A6BD"
);
_rc
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
_contRc
.
getWidth
()
+
5
,
0
)
);
_rc
.
setTrans
late
(
_contRc
.
getWidth
()
+
5
,
0
);
};
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriorityCommand"
,
(
function
()
{
return
{
...
...
src/module/layout.bottom.js
View file @
f608c0ab
...
...
@@ -57,7 +57,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
var
nodeType
=
node
.
getType
();
var
nodeX
=
nodeShape
.
getRenderBox
().
closurePoints
[
1
].
x
+
5
;
var
nodeY
=
nodeShape
.
getRenderBox
().
closurePoints
[
0
].
y
;
this
.
shape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
nodeX
,
nodeY
)
);
this
.
shape
.
setTrans
late
(
nodeX
,
nodeY
);
},
remove
:
function
()
{
this
.
shape
.
remove
();
...
...
@@ -154,7 +154,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
default
:
break
;
}
contRc
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
nodeStyle
.
padding
[
3
],
nodeStyle
.
padding
[
0
]
+
_contRCHeight
/
2
)
);
contRc
.
setTrans
late
(
nodeStyle
.
padding
[
3
],
nodeStyle
.
padding
[
0
]
+
_contRCHeight
/
2
);
};
var
updateLayoutMain
=
function
()
{
var
_root
=
minder
.
getRoot
();
...
...
@@ -260,17 +260,17 @@ KityMinder.registerModule( "LayoutBottom", function () {
var
_rectWidth
=
nodeShape
.
getWidth
();
switch
(
align
)
{
case
"right"
:
nodeShape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
Layout
.
x
-
_rectWidth
,
Layout
.
y
)
);
nodeShape
.
setTrans
late
(
Layout
.
x
-
_rectWidth
,
Layout
.
y
);
break
;
case
"center"
:
nodeShape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
Layout
.
x
-
_rectWidth
/
2
,
Layout
.
y
)
);
nodeShape
.
setTrans
late
(
Layout
.
x
-
_rectWidth
/
2
,
Layout
.
y
);
break
;
default
:
nodeShape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
Layout
.
x
,
Layout
.
y
)
);
nodeShape
.
setTrans
late
(
Layout
.
x
,
Layout
.
y
);
break
;
}
if
(
node
.
getType
()
===
"main"
)
{
Layout
.
subgroup
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
Layout
.
x
,
Layout
.
y
+
node
.
getRenderContainer
().
getHeight
()
)
);
Layout
.
subgroup
.
setTrans
late
(
Layout
.
x
,
Layout
.
y
+
node
.
getRenderContainer
().
getHeight
(
)
);
}
node
.
setPoint
(
Layout
.
x
,
Layout
.
y
);
};
...
...
src/module/layout.default.js
View file @
f608c0ab
...
...
@@ -58,7 +58,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
nodeX
=
nodeShape
.
getRenderBox
().
closurePoints
[
0
].
x
+
6
;
if
(
node
.
getType
()
===
"main"
)
nodeX
-=
3
;
}
this
.
shape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
nodeX
,
nodeY
)
);
this
.
shape
.
setTrans
late
(
nodeX
,
nodeY
);
},
remove
:
function
()
{
this
.
shape
.
remove
();
...
...
@@ -176,7 +176,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
default
:
break
;
}
contRc
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
nodeStyle
.
padding
[
3
],
nodeStyle
.
padding
[
0
]
+
_contRCHeight
/
2
)
);
contRc
.
setTrans
late
(
nodeStyle
.
padding
[
3
],
nodeStyle
.
padding
[
0
]
+
_contRCHeight
/
2
);
};
//计算节点在垂直方向的位置
var
updateLayoutVertical
=
function
(
node
,
parent
,
action
)
{
...
...
@@ -326,13 +326,13 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
_rectWidth
=
nodeShape
.
getWidth
();
switch
(
align
)
{
case
"right"
:
nodeShape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
Layout
.
x
-
_rectWidth
,
Layout
.
y
-
_rectHeight
/
2
)
);
nodeShape
.
setTrans
late
(
Layout
.
x
-
_rectWidth
,
Layout
.
y
-
_rectHeight
/
2
);
break
;
case
"center"
:
nodeShape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
Layout
.
x
-
_rectWidth
/
2
,
Layout
.
y
-
_rectHeight
/
2
)
);
nodeShape
.
setTrans
late
(
Layout
.
x
-
_rectWidth
/
2
,
Layout
.
y
-
_rectHeight
/
2
);
break
;
default
:
nodeShape
.
setTrans
form
(
new
kity
.
Matrix
().
translate
(
Layout
.
x
,
Layout
.
y
-
_rectHeight
/
2
)
);
nodeShape
.
setTrans
late
(
Layout
.
x
,
Layout
.
y
-
_rectHeight
/
2
);
break
;
}
node
.
setPoint
(
Layout
.
x
,
Layout
.
y
);
...
...
@@ -392,8 +392,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
.
clear
()
.
moveTo
(
sX
,
sY
)
.
lineTo
(
sX
,
nodeY
>
sY
?
(
nodeY
-
nodeStyle
.
margin
[
3
]
)
:
(
nodeY
+
nodeStyle
.
margin
[
3
]
)
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
nodeX
,
nodeY
,
0
,
1
);
else
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
nodeX
,
nodeY
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
0
,
0
,
nodeX
,
nodeY
,
0
,
1
);
else
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
0
,
0
,
nodeX
,
nodeY
);
connect
.
stroke
(
nodeStyle
.
stroke
);
}
else
{
sX
=
parentBox
.
closurePoints
[
0
].
x
+
parentStyle
.
margin
[
1
];
...
...
@@ -402,8 +402,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
.
clear
()
.
moveTo
(
sX
,
sY
)
.
lineTo
(
sX
,
nodeY
>
sY
?
(
nodeY
-
nodeStyle
.
margin
[
3
]
)
:
(
nodeY
+
nodeStyle
.
margin
[
3
]
)
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
nodeX
,
nodeY
);
else
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
nodeX
,
nodeY
,
0
,
1
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
0
,
0
,
nodeX
,
nodeY
);
else
connect
.
getDrawer
().
carcTo
(
nodeStyle
.
margin
[
3
],
0
,
1
,
nodeX
,
nodeY
);
connect
.
stroke
(
nodeStyle
.
stroke
);
}
}
...
...
src/module/layout.js
View file @
f608c0ab
...
...
@@ -34,9 +34,8 @@ KityMinder.registerModule( "LayoutModule", function () {
},
initStyle
:
function
()
{
var
curStyle
=
this
.
getCurrentStyle
();
var
lastTransform
=
this
.
_rc
.
getTransform
();
this
.
_rc
.
remove
();
this
.
_rc
=
new
kity
.
Group
()
.
setTransform
(
lastTransform
)
;
this
.
_rc
=
new
kity
.
Group
();
this
.
_paper
.
addShape
(
this
.
_rc
);
var
_root
=
this
.
getRoot
();
...
...
src/module/view.js
View file @
f608c0ab
...
...
@@ -102,7 +102,7 @@ KityMinder.registerModule( 'View', function () {
base
:
Command
,
execute
:
function
(
km
,
focusNode
)
{
var
viewport
=
km
.
getPaper
().
getViewPort
();
var
offset
=
focusNode
.
getRenderContainer
().
getRenderBox
(
km
.
getRenderContainer
()
);
var
offset
=
focusNode
.
getRenderContainer
().
getRenderBox
(
'paper'
);
var
dx
=
viewport
.
center
.
x
-
offset
.
x
-
offset
.
width
/
2
,
dy
=
viewport
.
center
.
y
-
offset
.
y
;
km
.
getRenderContainer
().
fxTranslate
(
dx
,
dy
,
1000
,
"easeOutQuint"
);
...
...
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