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
88d70148
Commit
88d70148
authored
May 24, 2017
by
zhangbobell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(png): traverse the tree to judge if it has image
parent
2e933bd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
png.js
src/protocol/png.js
+19
-12
No files found.
src/protocol/png.js
View file @
88d70148
...
@@ -120,23 +120,20 @@ define(function(require, exports, module) {
...
@@ -120,23 +120,20 @@ define(function(require, exports, module) {
//svgUrl = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svgXml);
//svgUrl = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svgXml);
var
allNodes
=
minder
.
getAllNode
();
var
imagesInfo
=
[];
var
imagesInfo
=
[];
for
(
var
i
=
0
;
i
<
allNodes
.
length
;
i
++
)
{
// 遍历取出图片信息
var
nodeData
=
allNodes
[
i
].
data
;
traverse
(
minder
.
getRoot
())
;
if
(
nodeData
.
image
&&
nodeData
.
expandState
===
'expand'
)
{
function
traverse
(
node
)
{
/*
var
nodeData
=
node
.
data
;
* 导出之前渲染这个节点,否则取出的 contentBox 不对
* by zhangbobell
if
(
nodeData
.
image
)
{
* */
minder
.
renderNode
(
node
);
minder
.
renderNode
(
allNodes
[
i
])
;
var
nodeData
=
node
.
data
;
var
imageUrl
=
nodeData
.
image
;
var
imageUrl
=
nodeData
.
image
;
var
imageSize
=
nodeData
.
imageSize
;
var
imageSize
=
nodeData
.
imageSize
;
var
imageRenderBox
=
node
.
getRenderBox
(
"ImageRenderer"
,
minder
.
getRenderContainer
());
var
imageRenderBox
=
allNodes
[
i
].
getRenderBox
(
'ImageRenderer'
,
minder
.
getRenderContainer
());
var
imageInfo
=
{
var
imageInfo
=
{
url
:
imageUrl
,
url
:
imageUrl
,
width
:
imageSize
.
width
,
width
:
imageSize
.
width
,
...
@@ -147,6 +144,16 @@ define(function(require, exports, module) {
...
@@ -147,6 +144,16 @@ define(function(require, exports, module) {
imagesInfo
.
push
(
imageInfo
);
imagesInfo
.
push
(
imageInfo
);
}
}
// 若节点折叠,则直接返回
if
(
nodeData
.
expandState
===
'collapse'
)
{
return
;
}
var
children
=
node
.
getChildren
();
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
traverse
(
children
[
i
]);
}
}
}
return
{
return
{
...
...
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