mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Fix Item#pivot test.
This commit is contained in:
parent
c0a5e1fdbc
commit
be603c7da8
1 changed files with 9 additions and 8 deletions
|
@ -725,14 +725,15 @@ test('Item#pivot', function() {
|
|||
applyMatrix: true
|
||||
});
|
||||
|
||||
var pivot1 = path1.bounds.topLeft.clone();
|
||||
path1.pivot = pivot1;
|
||||
path1.position = [200, 200];
|
||||
equals(path1.pivot, pivot1, 'Changing position of an item with applyMatrix = false should not change pivot.');
|
||||
var pivot = new Point(100, 100);
|
||||
|
||||
var pivot2 = path2.bounds.topLeft.clone();
|
||||
path2.pivot = pivot2;
|
||||
path2.position = [200, 200];
|
||||
equals(path2.pivot, pivot2, 'Changing position of an item with applyMatrix = true should change pivot.');
|
||||
path1.pivot = pivot;
|
||||
path1.position = [200, 200];
|
||||
equals(path1.pivot, pivot, 'Changing position of an item with applyMatrix = false should not change pivot');
|
||||
|
||||
var difference = new Point(100, 100);
|
||||
path2.pivot = pivot;
|
||||
path2.position = path2.position.add(difference);
|
||||
equals(path2.pivot, pivot.add(difference), 'Changing position of an item with applyMatrix = true should change pivot');
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue