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
89c16d02
Commit
89c16d02
authored
Sep 22, 2016
by
张博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(svg): fixed svg export in Safari
parent
9b376638
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
svg.js
src/protocol/svg.js
+7
-5
No files found.
src/protocol/svg.js
View file @
89c16d02
...
...
@@ -206,9 +206,9 @@ define(function(require, exports, module) {
}
}
}
svgDom
.
style
.
display
=
"none
"
;
svgDom
.
style
.
visibility
=
"hidden
"
;
replaceWithNode
(
svgDom
,
x
||
0
,
y
||
0
);
svgDom
.
style
.
display
=
"inlin
e"
;
svgDom
.
style
.
visibility
=
"visibl
e"
;
}
data
.
registerProtocol
(
"svg"
,
module
.
exports
=
{
fileDescription
:
"SVG 矢量图"
,
...
...
@@ -221,17 +221,19 @@ define(function(require, exports, module) {
svgXml
=
paper
.
container
.
innerHTML
;
paper
.
shapeNode
.
setAttribute
(
"transform"
,
paperTransform
);
svgContainer
=
document
.
createElement
(
"div"
);
document
.
body
.
appendChild
(
svgContainer
);
svgContainer
.
innerHTML
=
svgXml
;
svgDom
=
svgContainer
.
querySelector
(
"svg"
);
svgDom
.
setAttribute
(
"width"
,
width
+
padding
*
2
|
0
);
svgDom
.
setAttribute
(
"height"
,
height
+
padding
*
2
|
0
);
svgDom
.
setAttribute
(
"style"
,
"background: "
+
minder
.
getStyle
(
"background"
));
//"font-family: Arial, Microsoft Yahei, Heiti SC; " +
svgDom
.
setAttribute
(
"viewBox"
,
[
0
,
0
,
width
+
padding
*
2
|
0
,
height
+
padding
*
2
|
0
].
join
(
" "
));
s
vgContainer
=
document
.
createElement
(
"div"
);
tempS
vgContainer
=
document
.
createElement
(
"div"
);
cleanSVG
(
svgDom
,
renderBox
.
x
-
padding
|
0
,
renderBox
.
y
-
padding
|
0
);
svgContainer
.
appendChild
(
svgDom
);
document
.
body
.
removeChild
(
svgContainer
);
tempSvgContainer
.
appendChild
(
svgDom
);
// need a xml with width and height
svgXml
=
s
vgContainer
.
innerHTML
;
svgXml
=
tempS
vgContainer
.
innerHTML
;
// svg 含有 符号导出报错 Entity 'nbsp' not defined
svgXml
=
svgXml
.
replace
(
/ /g
,
" "
);
// svg 含有 符号导出报错 Entity 'nbsp' not defined
...
...
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