Function for making a scale transform

This commit is contained in:
Tim Schaub
2018-11-17 14:42:31 +01:00
parent 63cf21b668
commit db1f432197
2 changed files with 25 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import {
setFromArray,
translate,
scale,
makeScale,
rotate,
multiply,
compose,
@@ -69,6 +70,20 @@ describe('ol.transform', function() {
});
});
describe('makeScale()', function() {
it('creates a scale transform', function() {
const target = create();
makeScale(target, 2, 3);
expect(target).to.eql([2, 0, 0, 3, 0, 0]);
});
it('returns the target', function() {
const target = create();
const transform = makeScale(target, 2, 3);
expect(transform).to.be(target);
});
});
describe('rotate()', function() {
it('applies rotation to a transform', function() {
const transform = create();