diff --git a/examples/SVG Import/Gradients.html b/examples/SVG Import/Gradients.html index b9eae0b1..b4381f5c 100644 --- a/examples/SVG Import/Gradients.html +++ b/examples/SVG Import/Gradients.html @@ -5,103 +5,26 @@ Gradients - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/SVG Import/MoreGradients.html b/examples/SVG Import/MoreGradients.html new file mode 100644 index 00000000..b9eae0b1 --- /dev/null +++ b/examples/SVG Import/MoreGradients.html @@ -0,0 +1,107 @@ + + + + + Gradients + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index 07124ba2..c1f39fe3 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -322,12 +322,15 @@ new function() { color.setAlpha(parseFloat(value)); } - // Create apply-functions for attributes, and merge in those for SVGStlyes: - var attributes = Base.each(SVGStyles, function(entry) { + // Create apply-functions for attributes, and merge in those for SVGStlyes. + // We need to define style attributes first, and merge in all others after, + // since transform needs to be applied after fill color, as transformations + // can affect gradient fills. + var attributes = Base.merge(Base.each(SVGStyles, function(entry) { this[entry.attribute] = function(item, value, name, node) { item._style[entry.set](convertValue(value, entry.type)); }; - }, { + }, {}), { id: function(item, value) { definitions[value] = item; if (item.setName)