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
32ddd2cd
Commit
32ddd2cd
authored
Jan 12, 2015
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev
parent
ccaa40c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
render.js
src/core/render.js
+3
-1
clipboard.js
src/module/clipboard.js
+3
-0
view.js
src/module/view.js
+6
-5
No files found.
src/core/render.js
View file @
32ddd2cd
...
...
@@ -239,6 +239,7 @@ define(function(require, exports, module) {
},
getRenderer
:
function
(
type
)
{
var
rs
=
this
.
_renderers
;
if
(
!
rs
)
return
null
;
for
(
var
i
=
0
;
i
<
rs
.
length
;
i
++
)
{
if
(
rs
[
i
].
getType
()
==
type
)
return
rs
[
i
];
}
...
...
@@ -249,7 +250,8 @@ define(function(require, exports, module) {
return
this
.
parent
&&
this
.
parent
.
isCollapsed
()
?
new
kity
.
Box
()
:
(
this
.
_contentBox
||
new
kity
.
Box
());
},
getRenderBox
:
function
(
rendererType
,
refer
)
{
var
contentBox
=
rendererType
?
this
.
getRenderer
(
rendererType
).
contentBox
:
this
.
getContentBox
();
var
renderer
=
rendererType
&&
this
.
getRenderer
(
rendererType
);
var
contentBox
=
renderer
?
renderer
.
contentBox
:
this
.
getContentBox
();
var
ctm
=
kity
.
Matrix
.
getCTM
(
this
.
getRenderContainer
(),
refer
||
'paper'
);
return
ctm
.
transformBox
(
contentBox
);
}
...
...
src/module/clipboard.js
View file @
32ddd2cd
...
...
@@ -26,6 +26,9 @@ define(function(require, exports, module) {
function
sendToClipboard
(
nodes
)
{
if
(
!
nodes
.
length
)
return
;
nodes
.
sort
(
function
(
a
,
b
)
{
return
b
.
getIndex
()
-
a
.
getIndex
();
});
_clipboardNodes
=
nodes
.
map
(
function
(
node
)
{
return
node
.
clone
();
});
...
...
src/module/view.js
View file @
32ddd2cd
...
...
@@ -326,20 +326,21 @@ define(function(require, exports, module) {
var
dragger
=
this
.
_viewDragger
;
var
view
=
dragger
.
getView
();
var
focus
=
selected
.
getLayoutBox
();
var
space
=
50
;
var
space
=
150
;
var
tolerance
=
150
;
var
dx
=
0
,
dy
=
0
;
if
(
focus
.
right
>
view
.
right
)
{
if
(
focus
.
right
>
view
.
right
-
tolerance
)
{
dx
+=
view
.
right
-
focus
.
right
-
space
;
}
else
if
(
focus
.
left
<
view
.
left
)
{
}
else
if
(
focus
.
left
<
view
.
left
+
tolerance
)
{
dx
+=
view
.
left
-
focus
.
left
+
space
;
}
if
(
focus
.
bottom
>
view
.
bottom
)
{
if
(
focus
.
bottom
>
view
.
bottom
-
tolerance
)
{
dy
+=
view
.
bottom
-
focus
.
bottom
-
space
;
}
if
(
focus
.
top
<
view
.
top
)
{
if
(
focus
.
top
<
view
.
top
+
tolerance
)
{
dy
+=
view
.
top
-
focus
.
top
+
space
;
}
...
...
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