mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Merge branch 'refs/heads/master' into bool-cleanup
This commit is contained in:
commit
81137ce7fc
1 changed files with 10 additions and 8 deletions
|
@ -41,11 +41,12 @@ test('Decomposition: scale()', function() {
|
|||
function testScale(sx, sy, ex, ey, ea) {
|
||||
var m = new Matrix().scale(sx, sy),
|
||||
s = 'new Matrix().scale(' + sx + ', ' + sy + ')';
|
||||
equals(m.getScaling(), new Point(Base.pick(ex, sx), Base.pick(ey, sy)),
|
||||
s + '.getScaling()');
|
||||
equals(m.getRotation(), ea || 0,
|
||||
s + '.getRotation()',
|
||||
Numerical.TOLERANCE);
|
||||
s + '.getRotation()',
|
||||
Numerical.TOLERANCE);
|
||||
comparePoints(m.getScaling(), new Point(Base.pick(ex, sx),
|
||||
Base.pick(ey, sy)),
|
||||
s + '.getScaling()');
|
||||
}
|
||||
|
||||
testScale(1, 1);
|
||||
|
@ -63,11 +64,12 @@ test('Decomposition: rotate() & scale()', function() {
|
|||
function testAngleAndScale(sx, sy, a, ex, ey, ea) {
|
||||
var m = new Matrix().scale(sx, sy).rotate(a),
|
||||
s = 'new Matrix().scale(' + sx + ', ' + sy + ').rotate(' + a + ')';
|
||||
equals(m.getScaling(), new Point(Base.pick(ex, sx), Base.pick(ey, sy)),
|
||||
s + '.getScaling()');
|
||||
equals(m.getRotation(), ea || a,
|
||||
s + '.getRotation()',
|
||||
Numerical.TOLERANCE);
|
||||
s + '.getRotation()',
|
||||
Numerical.TOLERANCE);
|
||||
comparePoints(m.getScaling(), new Point(Base.pick(ex, sx),
|
||||
Base.pick(ey, sy)),
|
||||
s + '.getScaling()');
|
||||
}
|
||||
|
||||
testAngleAndScale(2, 4, 45);
|
||||
|
|
Loading…
Reference in a new issue