Add failing test for Curve#getParameter on a straight curve.

This commit is contained in:
Jonathan Puckey 2011-04-11 18:58:32 +02:00
parent 5f05c85b42
commit 0f80b11a07

View file

@ -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);
});