mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add test for #clockwise orientation in CompoundPath.
This commit is contained in:
parent
0fd8c4e046
commit
e9e93abb44
1 changed files with 30 additions and 0 deletions
|
@ -21,3 +21,33 @@ test('moveTo / lineTo', function() {
|
|||
return path.children.length;
|
||||
}, 2);
|
||||
});
|
||||
|
||||
test('clockwise', function() {
|
||||
var path1 = new Path.Rectangle([200, 200], [100, 100]);
|
||||
var path2 = new Path.Rectangle([50, 50], [200, 200]);
|
||||
var path3 = new Path.Rectangle([0, 0], [400, 400]);
|
||||
|
||||
equals(function() {
|
||||
return path1.clockwise;
|
||||
}, true);
|
||||
equals(function() {
|
||||
return path2.clockwise;
|
||||
}, true);
|
||||
equals(function() {
|
||||
return path3.clockwise;
|
||||
}, true);
|
||||
|
||||
new CompoundPath([
|
||||
path1, path2, path3
|
||||
]);
|
||||
|
||||
equals(function() {
|
||||
return path1.clockwise;
|
||||
}, true);
|
||||
equals(function() {
|
||||
return path2.clockwise;
|
||||
}, true);
|
||||
equals(function() {
|
||||
return path3.clockwise;
|
||||
}, false);
|
||||
})
|
Loading…
Reference in a new issue