-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var assert = chai.assert; | ||
|
||
describe("X axis skew", function() { | ||
|
||
it("should work with relative path", function() { | ||
assert.equal(new SVGPathData( | ||
'm100 75l-50 -45l0 90z' | ||
).skewX(Math.PI/2).encode(), | ||
'm175.29136163904155 75l-95.17481698342493 -45l90.34963396684985 90z'); | ||
}); | ||
|
||
it("should work with absolute path", function() { | ||
assert.equal(new SVGPathData( | ||
'M 100,75 50,30 50,120 z' | ||
).skewX(Math.PI/2).encode(), | ||
'M175.29136163904155 75L80.11654465561662 30L170.46617862246646 120z'); | ||
}); | ||
|
||
}); | ||
|
||
describe("Y axis skew", function() { | ||
|
||
it("should work with relative path", function() { | ||
assert.equal(new SVGPathData( | ||
'm100 75l-50 -45l0 90z' | ||
).skewY(Math.PI/2).encode(), | ||
'm100 175.3884821853887l-50 -95.19424109269436l0 90z'); | ||
}); | ||
|
||
it("should work with absolute path", function() { | ||
assert.equal(new SVGPathData( | ||
'M 100,75 50,30 50,120 z' | ||
).skewY(Math.PI/2).encode(), | ||
'M100 175.3884821853887L50 80.19424109269436L50 170.19424109269437z'); | ||
}); | ||
|
||
}); |