mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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) {
|
function testScale(sx, sy, ex, ey, ea) {
|
||||||
var m = new Matrix().scale(sx, sy),
|
var m = new Matrix().scale(sx, sy),
|
||||||
s = '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,
|
equals(m.getRotation(), ea || 0,
|
||||||
s + '.getRotation()',
|
s + '.getRotation()',
|
||||||
Numerical.TOLERANCE);
|
Numerical.TOLERANCE);
|
||||||
|
comparePoints(m.getScaling(), new Point(Base.pick(ex, sx),
|
||||||
|
Base.pick(ey, sy)),
|
||||||
|
s + '.getScaling()');
|
||||||
}
|
}
|
||||||
|
|
||||||
testScale(1, 1);
|
testScale(1, 1);
|
||||||
|
@ -63,11 +64,12 @@ test('Decomposition: rotate() & scale()', function() {
|
||||||
function testAngleAndScale(sx, sy, a, ex, ey, ea) {
|
function testAngleAndScale(sx, sy, a, ex, ey, ea) {
|
||||||
var m = new Matrix().scale(sx, sy).rotate(a),
|
var m = new Matrix().scale(sx, sy).rotate(a),
|
||||||
s = '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,
|
equals(m.getRotation(), ea || a,
|
||||||
s + '.getRotation()',
|
s + '.getRotation()',
|
||||||
Numerical.TOLERANCE);
|
Numerical.TOLERANCE);
|
||||||
|
comparePoints(m.getScaling(), new Point(Base.pick(ex, sx),
|
||||||
|
Base.pick(ey, sy)),
|
||||||
|
s + '.getScaling()');
|
||||||
}
|
}
|
||||||
|
|
||||||
testAngleAndScale(2, 4, 45);
|
testAngleAndScale(2, 4, 45);
|
||||||
|
|
Loading…
Reference in a new issue