Comparing version 2.1.6 to 2.2.0
@@ -0,1 +1,10 @@ | ||
2.2.0 / 2016-09-11 | ||
------------------ | ||
- Added `.skewX()` & `.skewY()` shortcuts. | ||
- Added typescript definitions. | ||
- Dropped `Makefile`, use npm instead. | ||
- Deps bump & cleanup. | ||
2.1.6 / 2016-03-09 | ||
@@ -2,0 +11,0 @@ ------------------ |
@@ -120,3 +120,3 @@ 'use strict'; | ||
Matrix.prototype.calc = function (x, y, isRelative) { | ||
var m, i, len; | ||
var m; | ||
@@ -123,0 +123,0 @@ // Don't change point on empty transforms queue |
@@ -189,4 +189,4 @@ 'use strict'; | ||
function scanSegment(state) { | ||
var max = state.max, cmdCode, comma_found, | ||
need_params, i; | ||
var max = state.max, | ||
cmdCode, comma_found, need_params, i; | ||
@@ -193,0 +193,0 @@ state.segmentStart = state.index; |
@@ -43,4 +43,3 @@ // SVG Path transformations library | ||
SvgPath.prototype.__matrix = function (m) { | ||
var self = this, | ||
ma, sx, sy, angle, arc2line, i; | ||
var self = this, i; | ||
@@ -221,2 +220,18 @@ // Quick leave for empty matrix | ||
// Skew path along the X axis by `degrees` angle | ||
// | ||
SvgPath.prototype.skewX = function (degrees) { | ||
this.__stack.push(matrix().skewX(degrees)); | ||
return this; | ||
}; | ||
// Skew path along the Y axis by `degrees` angle | ||
// | ||
SvgPath.prototype.skewY = function (degrees) { | ||
this.__stack.push(matrix().skewY(degrees)); | ||
return this; | ||
}; | ||
// Apply matrix transform (array of 6 elements) | ||
@@ -252,3 +267,3 @@ // | ||
this.segments.forEach(function (s) { | ||
var isRelative = (s[0].toLowerCase() === s[0]), t; | ||
var isRelative = (s[0].toLowerCase() === s[0]); | ||
@@ -347,3 +362,3 @@ switch (s[0]) { | ||
countourStartY = 0; | ||
var i, j, isRelative, newSegments; | ||
var i, j, newSegments; | ||
@@ -503,3 +518,3 @@ if (!keepLazyStack) { | ||
this.iterate(function (s, index, x, y) { | ||
var i, new_segments, nextX, nextY, result = [], name = s[0]; | ||
var new_segments, nextX, nextY, result = [], name = s[0]; | ||
@@ -506,0 +521,0 @@ // Skip anything except arcs |
{ | ||
"name": "svgpath", | ||
"version": "2.1.6", | ||
"version": "2.2.0", | ||
"description": "Low level toolkit for SVG paths transformations.", | ||
@@ -17,17 +17,20 @@ "keywords": [ | ||
"scripts": { | ||
"test": "make test" | ||
"lint": "eslint .", | ||
"test": "npm run lint && mocha", | ||
"coverage": "rm -rf coverage && istanbul cover _mocha", | ||
"report-coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"lib/" | ||
], | ||
"devDependencies": { | ||
"ansi": "*", | ||
"benchmark": "*", | ||
"coveralls": "~2.11.2", | ||
"eslint": "0.19.0", | ||
"eslint-plugin-nodeca": "~1.0.3", | ||
"istanbul": "*", | ||
"mocha": "*" | ||
"ansi": "^0.3.1", | ||
"benchmark": "^2.1.1", | ||
"coveralls": "^2.11.2", | ||
"eslint": "^3.5.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.0.2" | ||
} | ||
} |
@@ -73,6 +73,16 @@ svgpath | ||
Rotate path to `angle` degree around (rx, ry) point. If rotation center not set, | ||
Rotate path to `angle` degrees around (rx, ry) point. If rotation center not set, | ||
(0, 0) used. The same as SVG `rotate` transformation. | ||
### .skewX(degrees) -> self | ||
Skew path along the X axis by `degrees` angle. | ||
### .skewY(degrees) -> self | ||
Skew path along the Y axis by `degrees` angle. | ||
### .matrix([ m1, m2, m3, m4, m5, m6 ]) -> self | ||
@@ -79,0 +89,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41968
6
12
1145
147