From 075b66c01c85a5b90e23d321afbc1ff64634678c Mon Sep 17 00:00:00 2001 From: MoyuScript Date: Tue, 12 Dec 2017 22:08:46 +0800 Subject: [PATCH] Fix NaN color stop in IE --- src/Gradient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gradient.js b/src/Gradient.js index a197dbd..e4169a3 100644 --- a/src/Gradient.js +++ b/src/Gradient.js @@ -141,7 +141,7 @@ const parseColorStops = (args: Array, firstColorStopIndex: number, lineL return { color, // $FlowFixMe - stop: stop ? stop.getAbsoluteValue(lineLength) / lineLength : null + stop: lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null }; });