mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Define failing test for issue #200.
This commit is contained in:
parent
74f6a93b33
commit
24443c548a
1 changed files with 11 additions and 1 deletions
|
@ -36,10 +36,20 @@ test('path.curves Synchronisation', function() {
|
|||
equals(path.curves.toString(), "{ point1: { x: 0, y: 100 }, point2: { x: 100, y: 100 } },{ point1: { x: 100, y: 100 }, point2: { x: 0, y: 100 } }", "path.curves: path.add(new Point(100, 100));\npath.removeSegments(1, 2);");
|
||||
|
||||
// Transform the path, and the curves length should be invalidated (first, force-cache the first segment's length by accessing it
|
||||
path.curves[0].length;
|
||||
var length = path.curves[0].length;
|
||||
ok(path.curves[0]._length, 'Curve length does not appear to be cached');
|
||||
path.scale(2, [0, 0]);
|
||||
equals(path.curves[0].length, 200, 'Curve length should be updated when path is transformed');
|
||||
|
||||
var points = [];
|
||||
for (var i = 0; i < 40; i++)
|
||||
points.push(Point.random());
|
||||
var path = new Path(points);
|
||||
equals(path.segments.length, 40, 'segments.length');
|
||||
equals(path.curves.length, 39, 'curves.length');
|
||||
path.removeSegments();
|
||||
equals(path.segments.length, 0, 'segments.length');
|
||||
equals(path.curves.length, 0, 'curves.length');
|
||||
});
|
||||
|
||||
test('path.curves on Closed Paths', function() {
|
||||
|
|
Loading…
Reference in a new issue