fix #33
This commit is contained in:
Horcrux
2016-05-13 11:15:05 +08:00
parent 080fcb86fd
commit ec67d4dae8
3 changed files with 3 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ class LinearGradientVertical extends Component{
width="300"
>
<Defs>
<LinearGradient id="grad" x1="0" y1="0" x2="0" y2="150">
<LinearGradient id="grad" x1={0} y1={0} x2={0} y2={150}>
<Stop offset="0%" stopColor="rgb(255,255,0)" stopOpacity="0" />
<Stop offset="100%" stopColor="red" stopOpacity="1" />
</LinearGradient>

View File

@@ -1,5 +1,4 @@
import {PropTypes} from 'react';
import stopsOpacity from '../lib/stopsOpacity';
import {numberProp} from '../lib/props';
import Gradient from './Gradient';
@@ -7,7 +6,7 @@ import {LINEAR_GRADIENT} from '../lib/extract/extractBrush';
import insertColorStopsIntoArray from '../lib/insertProcessor';
function LinearGradientGenerator(stops, x1, y1, x2, y2) {
var brushData = [LINEAR_GRADIENT, x1, y1, x2, y2];
let brushData = [LINEAR_GRADIENT, ...[x1, y1, x2, y2].map(prop => prop.toString())];
insertColorStopsIntoArray(stops, brushData, 5);
this._brush = brushData;
}

View File

@@ -7,7 +7,7 @@ import insertColorStopsIntoArray from '../lib/insertProcessor';
function RadialGradientGenerator(stops, fx, fy, rx, ry, cx, cy) {
var brushData = [RADIAL_GRADIENT, fx, fy, rx, ry, cx, cy];
let brushData = [RADIAL_GRADIENT, ...[fx, fy, rx, ry, cx, cy].map(prop => prop.toString())];
insertColorStopsIntoArray(stops, brushData, 7);
this._brush = brushData;
}