mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add a test for Curve#getParameter(), with benchmarking too for now.
This commit is contained in:
parent
65900f8790
commit
b1915fcb62
1 changed files with 13 additions and 1 deletions
|
@ -6,5 +6,17 @@ test('path.length', function() {
|
|||
new Segment(new Point(121, 334), new Point(-19, 38), new Point(30.7666015625, -61.53369140625)),
|
||||
new Segment(new Point(248, 320), new Point(-42, -74), new Point(42, 74))
|
||||
]);
|
||||
compareNumbers(path.length, 172.10122680664062);
|
||||
var t = Date.now(), c = 1000;
|
||||
for (var i = 0; i < c; i++) {
|
||||
var length = path.length;
|
||||
}
|
||||
window.console.log(Date.now() - t, length);
|
||||
compareNumbers(length, 172.10122680664062);
|
||||
|
||||
var t = Date.now(), c = 1000;
|
||||
for (var i = 0; i < c; i++) {
|
||||
var param = path.curves[0].getParameter(length / 4);
|
||||
}
|
||||
window.console.log(Date.now() - t, param);
|
||||
compareNumbers(param, 0.2255848449949521);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue