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
56423a1f
Commit
56423a1f
authored
Jan 06, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev
parent
6ea9d9cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
keyboard.js
src/module/keyboard.js
+4
-2
mouse.js
src/module/mouse.js
+17
-8
No files found.
src/module/keyboard.js
View file @
56423a1f
...
...
@@ -23,7 +23,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
function
findClosestPointsFor
(
pointIndexes
,
iFind
)
{
var
find
=
pointIndexes
[
iFind
];
var
matrix
=
new
kity
.
Matrix
().
translate
(
-
find
.
x
,
-
find
.
y
).
rotate
(
-
45
);
var
matrix
=
new
kity
.
Matrix
().
translate
(
-
find
.
x
,
-
find
.
y
).
rotate
(
45
);
var
most
=
{},
quad
;
var
current
;
...
...
@@ -31,7 +31,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
if
(
i
==
iFind
)
continue
;
current
=
matrix
.
transformPoint
(
pointIndexes
[
i
].
x
,
pointIndexes
[
i
].
y
);
quad
=
quadOf
(
current
);
if
(
!
most
[
quad
]
||
current
.
length
()
<
most
[
quad
].
point
.
length
)
{
if
(
!
most
[
quad
]
||
current
.
length
()
<
most
[
quad
].
point
.
length
()
)
{
most
[
quad
]
=
{
point
:
current
,
node
:
pointIndexes
[
i
].
node
...
...
@@ -67,6 +67,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
km
.
toggleSelect
(
[
referNode
,
nextNode
]
);
km
.
execCommand
(
'rendernode'
,
[
referNode
,
nextNode
]
);
}
this
.
setContentChanged
(
false
);
}
}
);
...
...
@@ -78,6 +79,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
},
"events"
:
{
contentchange
:
function
()
{
console
.
log
(
'rebuild position network'
);
buildPositionNetwork
(
this
.
getRoot
()
);
},
keydown
:
function
(
e
)
{
...
...
src/module/mouse.js
View file @
56423a1f
KityMinder
.
registerModule
(
"MouseModule"
,
function
()
{
var
SingleSelectCommand
=
kity
.
createClass
(
'SingleSelectCommand'
,
{
base
:
Command
,
execute
:
function
(
km
,
node
)
{
var
deltaNodes
=
km
.
getSelectedNodes
();
km
.
clearSelect
();
if
(
node
)
{
km
.
selectSingle
(
node
);
deltaNodes
.
push
(
node
);
}
km
.
execCommand
(
'rendernode'
,
deltaNodes
);
this
.
setContentChanged
(
false
);
}
}
);
return
{
"commands"
:
{
'selectsingle'
:
SingleSelectCommand
},
"events"
:
{
mousedown
:
function
(
e
)
{
var
clickNode
=
e
.
getTargetNode
();
var
deltaNodes
=
this
.
getSelectedNodes
();
this
.
clearSelect
();
if
(
clickNode
)
{
this
.
selectSingle
(
clickNode
);
deltaNodes
.
push
(
clickNode
);
}
this
.
execCommand
(
'rendernode'
,
deltaNodes
);
this
.
execCommand
(
'selectsingle'
,
clickNode
);
}
}
};
...
...
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