mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Add CompoundPath tests.
This commit is contained in:
parent
deb1699f13
commit
2635326b24
1 changed files with 22 additions and 0 deletions
22
test/tests/CompoundPath.js
Normal file
22
test/tests/CompoundPath.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
module('Compound Path');
|
||||
|
||||
test('moveTo / lineTo', function() {
|
||||
var doc = new Doc(canvas);
|
||||
var path = new CompoundPath();
|
||||
|
||||
var lists = [
|
||||
[new Point(279, 151), new Point(149, 151), new Point(149, 281), new Point(279, 281)],
|
||||
[new Point(319, 321), new Point(109, 321), new Point(109, 111), new Point(319, 111)]
|
||||
];
|
||||
|
||||
for (var i = 0; i < lists.length; i++) {
|
||||
var list = lists[i];
|
||||
for (var j = 0; j < list.length; j++) {
|
||||
path[j == 0 ? 'moveTo' : 'lineTo'](list[j]);
|
||||
}
|
||||
}
|
||||
|
||||
path.fillColor = 'black';
|
||||
|
||||
equals(path.children.length, 2);
|
||||
});
|
Loading…
Reference in a new issue