From 88a7fcc92b7a877c94f0430352178b1220852fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 6 Nov 2012 08:22:22 -0800 Subject: [PATCH] Convert null to 'none' as style values. --- src/svg/SvgExporter.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/svg/SvgExporter.js b/src/svg/SvgExporter.js index c81e7d0e..b45999ab 100644 --- a/src/svg/SvgExporter.js +++ b/src/svg/SvgExporter.js @@ -304,15 +304,16 @@ var SvgExporter = this.SvgExporter = new function() { // Get a given style only if it differs from the value on the parent // (A layer or group which can have style values in SVG). var value = style[entry.get](); - if (value != null && (!parentStyle - || !Base.equals(parentStyle[entry.get](), value))) { - attrs[entry.attribute] = entry.type === 'color' - ? value.toCssString() - : entry.type === 'array' - ? value.join(',') - : entry.type === 'number' - ? formatNumber(value) - : value; + if (!parentStyle || !Base.equals(parentStyle[entry.get](), value)) { + attrs[entry.attribute] = value == null + ? 'none' + : entry.type === 'color' + ? value.toCssString() + : entry.type === 'array' + ? value.join(',') + : entry.type === 'number' + ? formatNumber(value) + : value; } });