mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Go back to previous notation that works again.
This commit is contained in:
parent
93fe0216d2
commit
fc57fd2136
1 changed files with 22 additions and 22 deletions
|
@ -3,46 +3,46 @@ module('Path');
|
|||
test('path.join(path)', function() {
|
||||
var doc = new Document();
|
||||
var path = new Path();
|
||||
path.add([0, 0]);
|
||||
path.add([10, 0]);
|
||||
path.add(0, 0);
|
||||
path.add(10, 0);
|
||||
|
||||
var path2 = new Path();
|
||||
path2.add([10, 0]);
|
||||
path2.add([20, 10]);
|
||||
path2.add(10, 0);
|
||||
path2.add(20, 10);
|
||||
|
||||
path.join(path2);
|
||||
equals(path.segments.toString(), '{ point: { x: 0, y: 0 } },{ point: { x: 10, y: 0 } },{ point: { x: 20, y: 10 } }');
|
||||
equals(doc.activeLayer.children.length, 1);
|
||||
|
||||
var path = new Path();
|
||||
path.add([0, 0]);
|
||||
path.add([10, 0]);
|
||||
path.add(0, 0);
|
||||
path.add(10, 0);
|
||||
|
||||
var path2 = new Path();
|
||||
path2.add([20, 10]);
|
||||
path2.add([10, 0]);
|
||||
path2.add(20, 10);
|
||||
path2.add(10, 0);
|
||||
path.join(path2);
|
||||
equals(path.segments.toString(), '{ point: { x: 0, y: 0 } },{ point: { x: 10, y: 0 } },{ point: { x: 20, y: 10 } }');
|
||||
|
||||
var path = new Path();
|
||||
path.add([0, 0]);
|
||||
path.add([10, 0]);
|
||||
path.add(0, 0);
|
||||
path.add(10, 0);
|
||||
|
||||
var path2 = new Path();
|
||||
path2.add([30, 10]);
|
||||
path2.add([40, 0]);
|
||||
path2.add(30, 10);
|
||||
path2.add(40, 0);
|
||||
path.join(path2);
|
||||
equals(path.segments.toString(), '{ point: { x: 0, y: 0 } },{ point: { x: 10, y: 0 } },{ point: { x: 30, y: 10 } },{ point: { x: 40, y: 0 } }');
|
||||
|
||||
var path = new Path();
|
||||
path.add([0, 0]);
|
||||
path.add([10, 0]);
|
||||
path.add([20, 10]);
|
||||
path.add(0, 0);
|
||||
path.add(10, 0);
|
||||
path.add(20, 10);
|
||||
|
||||
var path2 = new Path();
|
||||
path2.add([0, 0]);
|
||||
path2.add([10, 5]);
|
||||
path2.add([20, 10]);
|
||||
path2.add(0, 0);
|
||||
path2.add(10, 5);
|
||||
path2.add(20, 10);
|
||||
|
||||
path.join(path2);
|
||||
|
||||
|
@ -53,10 +53,10 @@ test('path.join(path)', function() {
|
|||
test('path.remove()', function() {
|
||||
var doc = new Document();
|
||||
var path = new Path();
|
||||
path.add([0, 0]);
|
||||
path.add([10, 0]);
|
||||
path.add([20, 0]);
|
||||
path.add([30, 0]);
|
||||
path.add(0, 0);
|
||||
path.add(10, 0);
|
||||
path.add(20, 0);
|
||||
path.add(30, 0);
|
||||
|
||||
path.removeSegment(0);
|
||||
equals(path.segments.length, 3);
|
||||
|
|
Loading…
Reference in a new issue