mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 14:05:09 +00:00
@@ -39,7 +39,7 @@ class LinearGradientVertical extends Component{
|
|||||||
width="300"
|
width="300"
|
||||||
>
|
>
|
||||||
<Defs>
|
<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="0%" stopColor="rgb(255,255,0)" stopOpacity="0" />
|
||||||
<Stop offset="100%" stopColor="red" stopOpacity="1" />
|
<Stop offset="100%" stopColor="red" stopOpacity="1" />
|
||||||
</LinearGradient>
|
</LinearGradient>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {PropTypes} from 'react';
|
import {PropTypes} from 'react';
|
||||||
|
|
||||||
import stopsOpacity from '../lib/stopsOpacity';
|
import stopsOpacity from '../lib/stopsOpacity';
|
||||||
import {numberProp} from '../lib/props';
|
import {numberProp} from '../lib/props';
|
||||||
import Gradient from './Gradient';
|
import Gradient from './Gradient';
|
||||||
@@ -7,7 +6,7 @@ import {LINEAR_GRADIENT} from '../lib/extract/extractBrush';
|
|||||||
import insertColorStopsIntoArray from '../lib/insertProcessor';
|
import insertColorStopsIntoArray from '../lib/insertProcessor';
|
||||||
|
|
||||||
function LinearGradientGenerator(stops, x1, y1, x2, y2) {
|
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);
|
insertColorStopsIntoArray(stops, brushData, 5);
|
||||||
this._brush = brushData;
|
this._brush = brushData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import insertColorStopsIntoArray from '../lib/insertProcessor';
|
|||||||
|
|
||||||
|
|
||||||
function RadialGradientGenerator(stops, fx, fy, rx, ry, cx, cy) {
|
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);
|
insertColorStopsIntoArray(stops, brushData, 7);
|
||||||
this._brush = brushData;
|
this._brush = brushData;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user