projects
/
raphael
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
plugins/raphael.export.js
[raphael]
/
plugins
/
raphael.export.js
diff --git
a/plugins/raphael.export.js
b/plugins/raphael.export.js
index
ba08574
..
24e14cc
100644
(file)
--- a/
plugins/raphael.export.js
+++ b/
plugins/raphael.export.js
@@
-163,9
+163,10
@@
return initial;
},
{
return initial;
},
{
- style: 'text-anchor: ' + (style.font.anchor ? style.font.anchor +';' : 'middle;') +
- styleToString(style) + ';' }
- ),
+ style: 'text-anchor: ' + (style.font.anchor ? (style.font.anchor +';' ): 'middle;') +
+ styleToString(style) + ';'
+ }
+ ),
node.matrix,
tag('tspan',
{
node.matrix,
tag('tspan',
{
@@
-187,9
+188,11
@@
reduce(
node.attrs,
function(initial, value, name) {
reduce(
node.attrs,
function(initial, value, name) {
- if ( name === 'path' ) name = 'd';
+ if ( name === 'path' ) {
+ name = 'd';
+ }
- initial[name] = value.toString();
+ initial[name] =
(typeof(value) == 'undefined') ? '' :
value.toString();
return initial;
},
return initial;
},
@@
-231,7
+234,7
@@
for ( i in node.attrs ) {
var name = i;
for ( i in node.attrs ) {
var name = i;
-
+ var val = node.attrs[i].toString();
switch ( i ) {
case 'src':
name = 'xlink:href';
switch ( i ) {
case 'src':
name = 'xlink:href';
@@
-239,12
+242,16
@@
break;
case 'transform':
name = '';
break;
case 'transform':
name = '';
-
break;
break;
+
+ case 'stroke':
+ case 'fill':
+ val = Raphael.getRGB(val).hex;
+ break;
}
if ( name ) {
}
if ( name ) {
- attrs += ' ' + name + '="' + escapeXML(
node.attrs[i].toString()
) + '"';
+ attrs += ' ' + name + '="' + escapeXML(
val
) + '"';
}
}
}
}