Skip to content

Commit

Permalink
Removed unnecessary absolute conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Nov 24, 2013
1 parent 4a38ad0 commit b4196ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
14 changes: 6 additions & 8 deletions dist/SVGPathData.js
Original file line number Diff line number Diff line change
Expand Up @@ -8095,24 +8095,22 @@ SVGPathDataTransformer.SKEW_Y = function(a) {

// Symetry througth the X axis
SVGPathDataTransformer.X_AXIS_SIMETRY = function(xDecal) {
return (function(toAbs, scale, translate) {
return (function(scale, translate) {
return function(command) {
return translate(scale(toAbs(command)));
return translate(scale(command));
};
})(SVGPathDataTransformer.TO_ABS(),
SVGPathDataTransformer.SCALE(-1, 1),
})(SVGPathDataTransformer.SCALE(-1, 1),
SVGPathDataTransformer.TRANSLATE(xDecal || 0, 0)
);
};

// Symetry througth the Y axis
SVGPathDataTransformer.Y_AXIS_SIMETRY = function(yDecal) {
return (function(toAbs, scale, translate) {
return (function(scale, translate) {
return function(command) {
return translate(scale(toAbs(command)));
return translate(scale(command));
};
})(SVGPathDataTransformer.TO_ABS(),
SVGPathDataTransformer.SCALE(1, -1),
})(SVGPathDataTransformer.SCALE(1, -1),
SVGPathDataTransformer.TRANSLATE(0, yDecal || 0)
);
};
Expand Down
14 changes: 6 additions & 8 deletions src/SVGPathDataTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,24 +204,22 @@ SVGPathDataTransformer.SKEW_Y = function(a) {

// Symetry througth the X axis
SVGPathDataTransformer.X_AXIS_SIMETRY = function(xDecal) {
return (function(toAbs, scale, translate) {
return (function(scale, translate) {
return function(command) {
return translate(scale(toAbs(command)));
return translate(scale(command));
};
})(SVGPathDataTransformer.TO_ABS(),
SVGPathDataTransformer.SCALE(-1, 1),
})(SVGPathDataTransformer.SCALE(-1, 1),
SVGPathDataTransformer.TRANSLATE(xDecal || 0, 0)
);
};

// Symetry througth the Y axis
SVGPathDataTransformer.Y_AXIS_SIMETRY = function(yDecal) {
return (function(toAbs, scale, translate) {
return (function(scale, translate) {
return function(command) {
return translate(scale(toAbs(command)));
return translate(scale(command));
};
})(SVGPathDataTransformer.TO_ABS(),
SVGPathDataTransformer.SCALE(1, -1),
})(SVGPathDataTransformer.SCALE(1, -1),
SVGPathDataTransformer.TRANSLATE(0, yDecal || 0)
);
};
Expand Down
8 changes: 4 additions & 4 deletions test/symetry.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b4196ce

Please sign in to comment.