Refactor to a more convenient internal API
This commit is contained in:
@@ -23,11 +23,11 @@ describe('ol.renderer.canvas.Layer', function() {
|
||||
},
|
||||
size: [10, 10],
|
||||
pixelRatio: 1,
|
||||
coordinateToPixelMatrix: ol.matrix.create(),
|
||||
pixelToCoordinateMatrix: ol.matrix.create()
|
||||
coordinateToPixelTransform: ol.transform.create(),
|
||||
pixelToCoordinateTransform: ol.transform.create()
|
||||
};
|
||||
renderer.getImageTransform = function() {
|
||||
return ol.matrix.create();
|
||||
return ol.transform.create();
|
||||
};
|
||||
ol.renderer.Map.prototype.calculateMatrices2D(frameState);
|
||||
var layerState = layer.getLayerState();
|
||||
@@ -62,7 +62,7 @@ describe('ol.renderer.canvas.Layer', function() {
|
||||
|
||||
|
||||
goog.require('ol.render.canvas');
|
||||
goog.require('ol.matrix');
|
||||
goog.require('ol.transform');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.renderer.Map');
|
||||
goog.require('ol.renderer.canvas.Layer');
|
||||
|
||||
@@ -49,32 +49,30 @@ describe('ol.renderer.webgl.ImageLayer', function() {
|
||||
pixelRatio, viewCenter, viewResolution, viewRotation, imageExtent);
|
||||
var matrix = renderer.getProjectionMatrix();
|
||||
|
||||
var output = ol.matrix.create();
|
||||
|
||||
ol.matrix.multVec2(matrix, [-1, -1], output);
|
||||
var output = ol.transform.apply(matrix, [-1, -1]);
|
||||
expect(output[0]).to.eql(-6);
|
||||
expect(output[1]).to.eql(-6);
|
||||
|
||||
ol.matrix.multVec2(matrix, [1, -1], output);
|
||||
output = ol.transform.apply(matrix, [1, -1]);
|
||||
expect(output[0]).to.eql(2);
|
||||
expect(output[1]).to.eql(-6);
|
||||
|
||||
ol.matrix.multVec2(matrix, [-1, 1], output);
|
||||
output = ol.transform.apply(matrix, [-1, 1]);
|
||||
expect(output[0]).to.eql(-6);
|
||||
expect(output[1]).to.eql(6);
|
||||
|
||||
ol.matrix.multVec2(matrix, [1, 1], output);
|
||||
output = ol.transform.apply(matrix, [1, 1]);
|
||||
expect(output[0]).to.eql(2);
|
||||
expect(output[1]).to.eql(6);
|
||||
|
||||
ol.matrix.multVec2(matrix, [0, 0], output);
|
||||
output = ol.transform.apply(matrix, [0, 0]);
|
||||
expect(output[0]).to.eql(-2);
|
||||
expect(output[1]).to.eql(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
goog.require('ol.matrix');
|
||||
goog.require('ol.transform');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.proj.common');
|
||||
goog.require('ol.layer.Image');
|
||||
|
||||
Reference in New Issue
Block a user