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
00ad01a9
Commit
00ad01a9
authored
Jun 27, 2016
by
Bo Zhang
Committed by
GitHub
Jun 27, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from bluewaitor/dev
导出png支持option参数
parents
3d0d775c
3eeb89f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
png.js
src/protocol/png.js
+6
-4
No files found.
src/protocol/png.js
View file @
00ad01a9
...
@@ -119,7 +119,7 @@ define(function(require, exports, module) {
...
@@ -119,7 +119,7 @@ define(function(require, exports, module) {
}
}
function
encode
(
json
,
minder
)
{
function
encode
(
json
,
minder
,
option
)
{
var
resultCallback
;
var
resultCallback
;
...
@@ -136,8 +136,10 @@ define(function(require, exports, module) {
...
@@ -136,8 +136,10 @@ define(function(require, exports, module) {
/* 获取 SVG 文件内容 */
/* 获取 SVG 文件内容 */
var
svgInfo
=
getSVGInfo
(
minder
);
var
svgInfo
=
getSVGInfo
(
minder
);
var
width
=
svgInfo
.
width
;
var
width
=
option
.
width
&&
option
.
width
>
svgInfo
.
width
?
option
.
width
:
svgInfo
.
width
;
var
height
=
svgInfo
.
height
;
var
height
=
option
.
height
&&
option
.
height
>
svgInfo
.
height
?
option
.
height
:
svgInfo
.
height
;
var
offsetX
=
option
.
width
&&
option
.
width
>
svgInfo
.
width
?
(
option
.
width
-
svgInfo
.
width
)
/
2
:
0
;
var
offsetY
=
option
.
height
&&
option
.
height
>
svgInfo
.
height
?
(
option
.
height
-
svgInfo
.
height
)
/
2
:
0
;
var
svgDataUrl
=
svgInfo
.
dataUrl
;
var
svgDataUrl
=
svgInfo
.
dataUrl
;
var
imagesInfo
=
svgInfo
.
imagesInfo
;
var
imagesInfo
=
svgInfo
.
imagesInfo
;
...
@@ -179,7 +181,7 @@ define(function(require, exports, module) {
...
@@ -179,7 +181,7 @@ define(function(require, exports, module) {
var
svgData
=
{
url
:
svgDataUrl
};
var
svgData
=
{
url
:
svgDataUrl
};
return
loadImage
(
svgData
).
then
(
function
(
$image
)
{
return
loadImage
(
svgData
).
then
(
function
(
$image
)
{
drawImage
(
ctx
,
$image
.
element
,
padding
,
padding
);
drawImage
(
ctx
,
$image
.
element
,
offsetX
,
offsetY
,
$image
.
width
,
$image
.
height
);
return
loadImages
(
imagesInfo
);
return
loadImages
(
imagesInfo
);
}).
then
(
function
(
$images
)
{
}).
then
(
function
(
$images
)
{
for
(
var
i
=
0
;
i
<
$images
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
$images
.
length
;
i
++
)
{
...
...
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