mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-31 13:52:58 +00:00
Use eslint, add travis-ci
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import SerializablePath from 'react-native/Libraries/ART/ARTSerializablePath';
|
||||
|
||||
import _ from 'lodash';
|
||||
const newLine = /\n/g;
|
||||
const defaultFontFamily = '"Helvetica Neue", "Helvetica", Arial';
|
||||
const fontRegExp = /^\s*((?:(?:normal|bold|italic)\s+)*)(?:(\d+(?:\.\d+)?)[ptexm%]*(?:\s*\/.*?)?\s+)?\s*"?([^"]*)/i;
|
||||
@@ -58,7 +58,7 @@ function parseFontString(font) {
|
||||
}
|
||||
|
||||
function extractFont(font) {
|
||||
if (font == null) {
|
||||
if (_.isNil(font)) {
|
||||
return null;
|
||||
}
|
||||
if (typeof font === 'string') {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import Transform from '../Transform';
|
||||
let pooledTransform = new Transform;
|
||||
import _ from 'lodash';
|
||||
let pooledTransform = new Transform();
|
||||
|
||||
function transformToMatrix(props) {
|
||||
let scaleX = props.scaleX != null ? props.scaleX :
|
||||
props.scale != null ? props.scale : 1;
|
||||
let scaleY = props.scaleY != null ? props.scaleY :
|
||||
props.scale != null ? props.scale : 1;
|
||||
let scaleX = !_.isNil(props.scaleX) ? props.scaleX :
|
||||
!_.isNil(props.scale) ? props.scale : 1;
|
||||
let scaleY = !_.isNil(props.scaleY) ? props.scaleY :
|
||||
!_.isNil(props.scale) ? props.scale : 1;
|
||||
|
||||
pooledTransform
|
||||
.transformTo(1, 0, 0, 1, 0, 0)
|
||||
@@ -13,7 +14,7 @@ function transformToMatrix(props) {
|
||||
.rotate(props.rotation || 0, props.originX, props.originY)
|
||||
.scale(scaleX, scaleY, props.originX, props.originY);
|
||||
|
||||
if (props.transform != null) {
|
||||
if (!_.isNil(props.transform)) {
|
||||
pooledTransform.transform(props.transform);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user