diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index 9fbaee67..168b0072 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -323,7 +323,7 @@ new function() { if (attrs.opacity === 1) delete attrs.opacity; - if (item._visibility != null && !item._visibility) + if (!item._visible) attrs.visibility = 'hidden'; return setAttributes(node, attrs); diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index aaf97433..392641cf 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -28,7 +28,7 @@ new function() { value = null; // Interpret value as number. Never return NaN, but 0 instead. // If the value is a sequence of numbers, parseFloat will - // return the first occuring number, which is enough for now. + // return the first occurring number, which is enough for now. return value == null ? allowNull ? null @@ -243,8 +243,8 @@ new function() { // Note the namespaced xlink:href attribute is just called href // as a property on node. // TODO: Support overflow and width, height, in combination with - // overflow: hidden. Paper.js currently does not suport PlacedSymbol - // clipping, but perhaps it should? + // overflow: hidden. Paper.js currently does not support + // PlacedSymbol clipping, but perhaps it should? var id = (getValue(node, 'href', true) || '').substring(1), definition = definitions[id], point = getPoint(node, 'x', 'y'); @@ -306,9 +306,9 @@ new function() { // Attributes and Styles - // NOTE: Parmeter sequence for all apply*() functions is: + // NOTE: Parameter sequence for all apply*() functions is: // (item, value, name, node) rather than (item, node, name, value), - // so we can ommit the less likely parameters from right to left. + // so we can omit the less likely parameters from right to left. function applyTransform(item, value, name, node) { // http://www.w3.org/TR/SVG/types.html#DataTypeTransformList @@ -411,6 +411,11 @@ new function() { item.setVisible(value === 'visible'); }, + display: function(item, value) { + // NOTE: 'none' gets translated to null in getAttribute() + item.setVisible(value !== null); + }, + 'stop-color': function(item, value) { // http://www.w3.org/TR/SVG/pservers.html#StopColorProperty if (item.setColor)