Fix NaN color stop in IE

This commit is contained in:
MoyuScript 2017-12-12 22:08:46 +08:00
parent 9fdba127bf
commit 075b66c01c

View File

@ -141,7 +141,7 @@ const parseColorStops = (args: Array<string>, firstColorStopIndex: number, lineL
return {
color,
// $FlowFixMe
stop: stop ? stop.getAbsoluteValue(lineLength) / lineLength : null
stop: lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null
};
});