Use matrix inversion to calculate pixel to coordinate matrix
This commit is contained in:
@@ -976,26 +976,9 @@ ol.Map.prototype.updateMatrices_ = function() {
|
|||||||
-center.y,
|
-center.y,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
goog.vec.Mat4.makeIdentity(this.pixelToCoordinateMatrix_);
|
var inverted = goog.vec.Mat4.invert(
|
||||||
goog.vec.Mat4.translate(this.pixelToCoordinateMatrix_,
|
this.coordinateToPixelMatrix_, this.pixelToCoordinateMatrix_);
|
||||||
center.x,
|
goog.asserts.assert(inverted);
|
||||||
center.y,
|
|
||||||
0);
|
|
||||||
if (this.canRotate() && goog.isDef(rotation)) {
|
|
||||||
goog.vec.Mat4.rotate(this.coordinateToPixelMatrix_,
|
|
||||||
-rotation,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
goog.vec.Mat4.scale(this.pixelToCoordinateMatrix_,
|
|
||||||
resolution,
|
|
||||||
-resolution,
|
|
||||||
1);
|
|
||||||
goog.vec.Mat4.translate(this.pixelToCoordinateMatrix_,
|
|
||||||
-size.width / 2,
|
|
||||||
-size.height / 2,
|
|
||||||
0);
|
|
||||||
|
|
||||||
this.matriciesDirty_ = false;
|
this.matriciesDirty_ = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user