mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -05:00
Add failing test for Curve#getParameter on a straight curve.
This commit is contained in:
parent
5f05c85b42
commit
0f80b11a07
1 changed files with 11 additions and 0 deletions
|
@ -29,3 +29,14 @@ test('path.length', function() {
|
|||
// 4: 0.22558508917324532
|
||||
compareNumbers(param, 0.2255849553116685);
|
||||
});
|
||||
|
||||
test('curve.getParameter with straight curve', function() {
|
||||
var doc = new Document();
|
||||
var path = new Path();
|
||||
path.moveTo(100, 100);
|
||||
path.lineTo(500, 500);
|
||||
var curve = path.curves[0];
|
||||
var length = curve.length;
|
||||
var t = curve.getParameter(length / 3);
|
||||
compareNumbers(t, 0.3869631475722452);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue