mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-21 06:15:15 +00:00
refactor Components props extracting
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
* based on
|
||||
* https://github.com/CreateJS/EaselJS/blob/631cdffb85eff9413dab43b4676f059b4232d291/src/easeljs/geom/Matrix2D.js
|
||||
*/
|
||||
import _ from 'lodash';
|
||||
const DEG_TO_RAD = Math.PI / 180;
|
||||
|
||||
/**
|
||||
@@ -25,7 +24,7 @@ const DEG_TO_RAD = Math.PI / 180;
|
||||
* @param {Number} [ty=0] Specifies the ty property for the new matrix.
|
||||
* @constructor
|
||||
**/
|
||||
class Matrix2D {
|
||||
export default class Matrix2D {
|
||||
constructor(a, b, c, d, tx, ty) {
|
||||
this.setTransform(a, b, c, d, tx, ty);
|
||||
|
||||
@@ -80,11 +79,11 @@ class Matrix2D {
|
||||
* @return {Matrix2D} This instance. Useful for chaining method calls.
|
||||
*/
|
||||
setTransform = function(a, b, c, d, tx, ty) {
|
||||
// don't forget to update docs in the constructor if these change:
|
||||
this.a = _.isNil(a) ? 1 : a;
|
||||
/*eslint eqeqeq:0*/
|
||||
this.a = a == null ? 1 : a;
|
||||
this.b = b || 0;
|
||||
this.c = c || 0;
|
||||
this.d = _.isNil(d) ? 1 : d;
|
||||
this.d = b == null ? 1 : d;
|
||||
this.tx = tx || 0;
|
||||
this.ty = ty || 0;
|
||||
return this;
|
||||
@@ -281,5 +280,3 @@ class Matrix2D {
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
export default Matrix2D;
|
||||
|
||||
Reference in New Issue
Block a user