From ff82e43d2fe7c2fe0cf62ba9f2d47ac3103f66d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 6 Apr 2016 20:17:13 -0700 Subject: [PATCH] Fix GradientStop support in SVG export. Closes #1027 --- src/svg/SvgExport.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/svg/SvgExport.js b/src/svg/SvgExport.js index 543ab730..ea6c6012 100644 --- a/src/svg/SvgExport.js +++ b/src/svg/SvgExport.js @@ -231,12 +231,11 @@ new function() { var stops = gradient._stops; for (var i = 0, l = stops.length; i < l; i++) { var stop = stops[i], - offset = stop._rampPoint, stopColor = stop._color, alpha = stopColor.getAlpha(); - attrs = {}; - if (offset != null) - attrs.offset = offset; + attrs = { + offset: stop._rampPoint || i / (l - 1) + }; if (stopColor) attrs['stop-color'] = stopColor.toCSS(true); // See applyStyle for an explanation of why there are separated